You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
andychu edited this page Mar 21, 2020
·
3 revisions
This is example has four double quotes. To determine whether it means OPEN OPEN CLOSE CLOSE or OPEN CLOSE OPEN CLOSE requires a full shell parser.
$ echo "foo ${myvar:-"$(f() { echo func-defined-inside-quotes-and-inside-arg; }; f)"} bar"
foo func-defined-inside-quotes-and-inside-arg bar
$ myvar=x
$ echo "foo ${myvar:-"$(f() { echo func-defined-inside-quotes-and-inside-arg; }; f)"} bar"
foo x bar
3/2020 edit: Although I guess you do not have to parse f() { } in order to figure out that the first " is OPEN. You only have to understand that ${ is not closed yet, which is not that hard I suppose.