Re: [newbie] How to copy and paste many command at once ?



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.
.