2 ms·
I’ve never had a problem in Bash with `$()` and newlines. All tools that I’ve used terminate their input with a newline. Is this a problem in other shells, perh
by keybored 3y ago
I’ve never had a problem in Bash with `$()` and newlines. All tools that I’ve used terminate their input with a newline. Is this a problem in other shells, perhaps?
- emj 3y agoUsing a linter is a good idea. It's not command substitution but the contentes in $variables will be expanded and splitted so you need to quote them or the newlines will get lost. $ touch asdd $ foo=$(echo -e '\n\nboop\n*dd\n'); echo $foo "$foo" boop asdd boop *dd Try create files with new lines and globbing in them, and forget to use quotes around filenames. Chaos ensues.