Author:
erics , April 18th, 2022
If you want to preserve quoting to pass shell arguments to a called command, use the four characters “$@” (including the double quotes) instead of the two characters $*
Categories: How-To's , Technology Tags: Argument , Arguments , bash , Command , howto , Keep , Preserve , quote , quotes , Quoting , Save , Shell , tips
| No comments
Author:
erics , July 14th, 2021
Solution: “Double Quote” your variables!
shell > myvar = "abc
def
ghi"
shell > echo $ myvar
abc def ghi
shell > echo "$myvar"
abc
def
ghi
See Also: https://stackoverflow.com/questions/22101778/how-to-preserve-line-breaks-when-storing-command-output-to-a-variable
Categories: How-To's , Technology Tags: Capture , Command , Command Output , howto , Keep , line break , Line Breaks , Preserve , Store , Storing , tips , Variable
| No comments