LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Shell Scripting Problem (https://www.linuxquestions.org/questions/linux-software-2/shell-scripting-problem-164640/)

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:

Code:

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

Code:

printf "qwerty\n\uiop\n\tIntented"
Or:

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


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