New lines in terminal
I am learning to use dar from the command line. My dar command is 3 lines long full width of the monitor. Is there a character sequence to insert between commands so that my 3 lines can be broken into more lines? A simple return causes the command not to run.
I searched on line length, man terminal, but was unable to locate what I am looking for. What I have (example): -X "*.*.dar" -X "*.jpg" --create /darbu -s 650M -y -v -Z "*.mp3" -Z "*.avi" -Z "*.mpg" -Z "*.mpeg" -Z "*.divx" -Z "*.rm" -Z "*.wmv" -Z "*.wma" -Z "*.asf" -Z "*.ra" -Z "*.gif" -Z "*.jpg" -Z "*.jpeg" -Z "*.png" -Z "*.zip" -Z "*.tgz" -Z "*.gzip" -Z "*.bzip" -Z "*.bzip2" -Z "*.rar" -Z "*.Z" --fs-root / -g home/mike/Desktop/autodealer --prune home/mike/tmp What I would like: -X "*.*.dar" -X "*.jpg" --create /darbu -s 650M -y -v -Z "*.mp3" -Z "*.avi" -Z "*.mpg" -Z "*.mpeg" -Z "*.divx" -Z "*.rm" -Z "*.wmv" -Z "*.wma" -Z "*.asf" -Z "*.ra" -Z "*.gif" -Z "*.jpg" -Z "*.jpeg" -Z "*.png" -Z "*.zip" -Z "*.tgz" -Z "*.gzip" -Z "*.bzip" -Z "*.bzip2" -Z "*.rar" -Z "*.Z" --fs-root / -g home/mike/Desktop/autodealer --prune home/mike/tmp But there needs to be a break of some type at the end of each line, and it cannot be a carriage return. Any suggestions on search topics? mg92865 |
Tried '\' already?
|
If you put a backslash \ at the end of the line (with no spaces after it), tyu can continue to enter a command on a new line,. e.g.
Code:
echo this is a long command which has \ |
The added \ solved the problem
Hello,
Thank you for the prompt response. Adding the \ solves my problem. I have not seen this. I looked for a man terminal page but none exists on my system. What would I have searched on to find more on the terminal or the use of "\" in terminal. Thanks, mg92865 |
Quote:
|
Quote:
Code:
echo -e "foo bah\nbaz" |
Quote:
Here are a few useful bash references for you: http://mywiki.wooledge.org/BashGuide http://wiki.bash-hackers.org/start http://www.linuxcommand.org/index.php http://wiki.bash-hackers.org/scripting/newbie_traps http://mywiki.wooledge.org/BashPitfalls http://mywiki.wooledge.org/BashFAQ http://tldp.org/LDP/Bash-Beginners-G...tml/index.html http://www.tldp.org/LDP/abs/html/index.html http://www.gnu.org/software/bash/manual/bashref.html http://ss64.com/bash/ |
Quote:
Quote:
|
I'm not entirely clear what you're asking here, but as above, the syntax of *nix shells is such that a newline is assumed to be the end of a cmd UNLESS you append a '\' at the physical end of the line.
You can print out '\n' if you want to see a new line, and echo can explicitly insert a newline as above or append (-n) instead of (default) putting a newline eg Code:
echo -en "foo bah\nbaz" |
Quote:
Code:
~/tmp$ echo this is a long command which has \ |
Thank you ntubski. That's what I was looking for.
|
All times are GMT -5. The time now is 04:03 PM. |