From: Saku Laesvuori <saku@laesvuori.fi>
To: "(" <paren@disroot.org>
Cc: Csepp <raingloom@riseup.net>, jgart <jgart@dismail.de>,
Ricardo Wurmus <rekado@elephly.net>,
help-guix@gnu.org
Subject: Re: Am I doing it all wrong?
Date: Sun, 28 Aug 2022 17:10:54 +0300 [thread overview]
Message-ID: <20220828141054.mufgp2an4qufdqbt@X-kone> (raw)
In-Reply-To: <CMHNOTY0PL3F.3962RLA2PZT4K@guix-aspire>
[-- Attachment #1: Type: text/plain, Size: 760 bytes --]
> > Also, that should probably be "$@", just in case.
>
> I don't think it'll make any difference; if, say, "foo" "bar" "baz" is
> passed, both $@ and "$@" will expand to "foo" "bar" "baz" (yes, bypassing
> the quotes).
>
> According to POSIX.1-2017's specification of `sh`:
>
> When the expansion occurs within double-quotes, the behavior is unspecified
> unless one of the following is true:
>
> + Field splitting [...] would be performed if the expansion were not within
> double-quotes [...].
>
> + [...]
>
> So, $@ == "$@".
It does actually make a difference if the arguments have spaces. Given
arguments "foo" and "foo bar", $@ expands to "foo" "foo" "bar" and "$@"
expands to "foo" "foo bar".
- Saku Laesvuori
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-08-28 14:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 15:34 Am I doing it all wrong? jgart
2022-08-27 17:15 ` Ricardo Wurmus
2022-08-27 18:38 ` jgart
2022-08-27 20:53 ` (
2022-08-27 20:56 ` (
2022-08-27 20:58 ` (
2022-08-28 11:50 ` Csepp
2022-08-28 12:21 ` (
2022-08-28 14:10 ` Saku Laesvuori [this message]
2022-08-27 20:45 ` (
2022-08-28 11:52 ` Csepp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220828141054.mufgp2an4qufdqbt@X-kone \
--to=saku@laesvuori.fi \
--cc=help-guix@gnu.org \
--cc=jgart@dismail.de \
--cc=paren@disroot.org \
--cc=raingloom@riseup.net \
--cc=rekado@elephly.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.