$ echo "line\nnewline" line\nnewline $ echo -e "line\nnewline" line newline $ lines=`echo -e "line\nnewline"` $ echo $lines line newline $ echo "$lines" line newlineClearly you must use -e if you want echo to recognize newline escape character (\n). In addition notice how quotes are needed to print the new line stored in a variable while the -e option is not needed.
No comments:
Post a Comment