Hot answers tagged

22

In your one-liner, the $1 is within a double quoted string: "cat <(date|awk '{print $1}')" This means that it will be expanded by the interactive shell. If the first positional parameter, $1, is empty, it will expand it to an empty string, resulting in an awk program that just prints its input: awk '{print }' Escape the $ in $1 as \$1 to stop the ...


2

Quoting !! When you execute ls -l, yes, it generates newlines (as you report). When you do echo `ls -l` , however there are no newlines to be seen. Try it. The reason is that a `...` construct is a command expansion, and most expansions (there are others) are affected by shell splitting (when not quoted). Shell splitting removes any of the characters in ...


1

This is a shell thing not a screen thing. You need to put the whole thing in single quotes. The only special character in single quotes is the single quote (it ends the quote). Therefore, this should word say_this 'message' e.g. say_this 'tellraw @p ["",{"text":"This is a text!","bold":true,"color":"gold"},{"text":"\n"},{"text":"More text to be seen here!...


1

Backslash is an escape character both within double quotes and in the sed replacement. So with "\\\"", sed sees \" which it takes to mean " Try single quotes: echo "replace FOO" | sed -e 's~FOO~test\\"test~g' or doubly escape: echo "replace FOO" | sed -e "s~FOO~test\\\\\"test~g"


Only top voted, non community-wiki answers of a minimum length are eligible