Hi I'm new to LINUX and I'm writing a shell script.
I noticed when I'm at the command line I can type:
and it will produce:
when I put that SAME line in a shell script I get:
Why? What can I use as CR character in a UNIX shell script that will work?
That's not a normal behavior, not in Bash. Are you using the c-shell csh/tcsh ? or perhaps you have echo defined as an environment variable that was not exported, so it only works in your current shell, but not in any subshell. If you use the c-shell you may sooner or later run into problems, since this shell is not sh or bash complient.
To enable the interpretation of backslash escape sequences in the korn or bourne shell you can use the -e paramter. For instance
[dude@vm210 ~]$ echo -e "one\ntwo"