I have a complex grep/awk/etc command line which use some " some $var already, which makes it even impossible to use
VAR="$( that command )"
to get all output
I don't want to create temp files, which make it even ugly,
is it possible to pass pipe output into a variable in bash
like
command | > $VAR
command > $VARwould create a file named$VAR.VAR="$( that command )"? Notice that inside $(...), you "go" into that level, which means you don't have to escape quotes. Ex: you can writeVAR="$(echo "toto titi")"instead ofVAR="$(echo \"toto titi\")". Using the first form (VAR="$(echo "toto titi")") You'll end up (after bash evaluate first the $(...) part) with VAR="toto titi", as needed.