Assuming user has 5 processes started, what is queried with below sentences:
cuser=`whoami` a="`ps -C process -o user= | grep $cuser`" echo $a user user user user user
echo "`ps -C process -o user= | grep $cuser`" user user user user user
Then it looks like in the 1st case the 'newline' or '\n' is converted to spaces, which seems a good idea.
It looks hard to see how space and newlines are handled in the shell in different situations.
It might need a complete manual for checking how spaces and newlines are handled in each occasion.
Any advice for how they are handled in each occasion?
Here pls. notice that 'newline' is converted into 'space'.
echo "$a" would then seem to preserve the newlines. This is then maybe echo-command properties to convert newlines to spaces.