|
|
|
|
|
by EvilTerran
3462 days ago
|
|
Sadly not: only quotes that appeared literally in the command-as-written affect word-splitting or are subject to quote removal, not those resulting from an expansion step (variable substitution, globbing, etc); so you'd end up with four elements in argv (or one if you double-quoted the variable reference), with literal single-quote characters in them. You'd have to do something unpleasant with "eval" to make that work. It's a sensible rule, when you think about it - otherwise, for example, an expansion that introduced mismatched quotes would cause total chaos. |
|
Example
This prints And if you really understand that ' and " turn quoting on and off anywhere in the line, you can combine these two into a single variable: