help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Backquote form of command substitution within double quo


From: Dennis Williamson
Subject: Re: [Help-bash] Backquote form of command substitution within double quotes
Date: Mon, 22 Jun 2015 19:36:14 -0500

On Mon, Jun 22, 2015 at 5:15 PM, Michael Convey <address@hidden> wrote:

> The posix standard says the following:
> ====================================================
> The backquote shall retain its special meaning introducing the other form
> of command substitution (see Command Substitution
> <
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_03
> >).
> The portion of the quoted string from the initial backquote and the
> characters up to the next backquote that is not preceded by a <backslash>,
> having escape characters removed, defines that command whose output
> replaces
> "`...`" when the word is expanded. Either of the following cases produces
> undefined results:
>
>    -
>
>    A single-quoted or double-quoted string that begins, but does not end,
>    within the "`...`" sequence
>    -
>
>    A "`...`" sequence that begins, but does not end, within the same
>    double-quoted string
>
> Source:
>
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_03
> ====================================================
>
> Is the first undefined case described by the following?
> command "`command "argu`"ment"
>
> Is the second undefined case described by the following?
> command "`command" argument`
>
> I'm not sure I understand these undefined cases (especially the 2nd one).
> Thoughts?
>

Use $() and forget that backquotes exist. I often recommend popping that
key off the keyboard.

-- 
Visit serverfault.com to get your system administration questions answered.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]