Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3343

Programming • Re: bash variables, newlines and double-quotes...

$
0
0
Shell scripting is hard, don't do it.
Like everybody, I do it a lot more than I'd admit.

Code:

echo $JUNK
calls echo with four arguments. Echo prints each argument separated by space.

Code:

echo "$JUNK"
calls echo with one argument. The argument includes newline characters.
Ha, yes, this makes sense. Thanks! :)

For some reason I was thinking of echo not evaluating args...

(echo junk) vs (echo 'junk) vs (echo a b c d) vs (echo 'a 'b 'c 'd) vs (echo '(a b c d)) ...ad infinitum, lol.

Statistics: Posted by bitrat — 2024-05-22 21:12



Viewing all articles
Browse latest Browse all 3343

Trending Articles