LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Multiple lines at the command line - how?! (http://www.linuxquestions.org/questions/linux-newbie-8/multiple-lines-at-the-command-line-how-864404/)

jsp_1983 02-22-2011 07:32 PM

Multiple lines at the command line - how?!
 
I've seen a few tutorials that have commands and parameters on multiple line, like the one below:

Code:

chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start

I can copy and paste this in Putty, but what if I want to manually type it? If I press return, the first line gets processed, so how do I insert a new line?

Tinkster 02-22-2011 07:51 PM

Code:

echo "hello" \
echo "And again"


chrism01 02-22-2011 08:02 PM

Usually that's just an artifact of the copy/paste (& display) of the document you are looking at ie auto-wrap. Normally that would all be input on one line.
Of course Tinkster is correct that you can fold the line using '\' if you really want to.

soplin 02-24-2011 10:27 PM

cat > commands.sh
Enter stuff
Enter stuff
Enter stuff
CTRL-D

sh commands.sh
cat commands.sh

jsp_1983 02-25-2011 08:04 PM

More than answered :)

Thanks!


All times are GMT -5. The time now is 11:30 AM.