-   Linux - Software (
-   -   Shell Scripting Problem (

linuxboy69 03-31-2004 03:19 PM

Shell Scripting Problem
what is the syntax for a line break? I thought that in linux it was \r\n and it works when I write it into a normal file from php but when i use scp to copy it to a remote server, it shows that data without line breaks and even has a "^M" where the line break is whatever that is suppose to be.

Any help would be greatly appreciated.

czarherr 03-31-2004 03:21 PM

i just use \n

cfaj 03-31-2004 08:36 PM

By default, echo doesn't convert \n or \t, but you can use the -e option:


echo -e "qwerty\n\uiop\n\tIntented"
Or you can use printf.


printf "qwerty\n\uiop\n\tIntented"

[CODE]printf "%b\n" "qwerty\n\uiop\n\tIndented"{/CODE]

All times are GMT -5. The time now is 07:01 PM.