Re: How to copy and paste many command at once ?
- From: "johngnub" <johngnub@xxxxxxx>
- Date: 27 Sep 2006 15:51:52 -0700
Many of the term's support the use of the shift-insert for pasteing
text in to the term, If the lines ( info ) are being copied from a
Win-app, then the control-c should put the text in to the paste buffer.
( putty is my fav, )
As to `;` or `&&`, dont forget the fun of `||`, try this for fun....
ls foobar && echo FOOBAR
touch foobar
ls foobar || echo NOFOOBAR
Try grep -q foobar to "test" for a regex match, and so on....
ls foobar |grep -q foobar || echo "NO FOOBAR"
Simple and silly example of the `;` as a command terminator, ,
echo a ; ( echo 1 ; echo 2 )
then try droping out the ';' and see the errors fly, just for fun.
You can end every comand with a ';' if you want too, that depends on
your level of paranoia, for example,
`ls ls` will error out, ie the 2nd ls is passed to ls to see if we have
an ls file, Opps, I wanted ls then ls to run. Thus `ls; ls` will work.
2 cents, JB
Steven Mocking wrote:
vd12005@xxxxxxxx wrote:
Hello,
i would like to know how am i suppose to finish my command lines to be
able to indent them and copy and paste them from Windows notepad to a
telnet screen ?
First of all, telnet is strongly discouraged by many worth listening to,
because it is trivial to intercept. Additionally, it is a pain to work
with. In putty (the canonical windows ssh client), you would simply
paste the text with the right mouse button and the application would
take care of the newline discrepancies.
for example carriage return seems incorrect, i used to write for
example :
"""
for f in `ls`
do
command 1
command 2
done
"""
but it is odd, work on somes unix, not on others
My crystal ball is kinda cloudy today. Care to elaborate?
now i sometimes uses ";" like in "command1 ; command2" and sometimes
uses "&&" like in "command1 && command2" but i do not know what is best
and if there are any differences ?
Generally a decent shell will treat ";" as "this is the end of the
command, now continue with whatever follows" and "&&" as "if the
previous command returned a zero exit status, continue".
should i write
"""
for f in `ls` ;
do ;
command 1 ;
command 2 ;
done ;
"""
to be sure it will work on any unix/linux like ?
No. It will work, but it's not necessary. All shells accept decent unix
newlines as seperators.
.
- References:
- [newbie] How to copy and paste many command at once ?
- From: vd12005
- Re: [newbie] How to copy and paste many command at once ?
- From: Steven Mocking
- [newbie] How to copy and paste many command at once ?
- Prev by Date: Re: [newbie] How to copy and paste many command at once ?
- Next by Date: Re: subtotalling identical records
- Previous by thread: Re: [newbie] How to copy and paste many command at once ?
- Next by thread: Re: [newbie] How to copy and paste many command at once ?
- Index(es):