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



On 2006-09-27, 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 ?

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

What doesn't work? What errors do you get?

That script is itself broken, as it cannot handle filenames
containing spaces. Replace `ls` with *; `ls` is unnecessary and
causes problems.

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 ?

should i write
"""
for f in `ls` ;
do ;
command 1 ;
command 2 ;
done ;
"""
to be sure it will work on any unix/linux like ?

thanks



--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.



Relevant Pages

  • Re: for do command in Solaris 10
    ... The command I am entering is. ... If you have sensible filenames, ... cp $(cat CDRfiles) /home/test/CDR ... Shell Scripting Recipes: ...
    (comp.unix.shell)
  • Re: BASH help please??
    ... IFS= read var ... String length greater than width! ... command already has its stdin connected to a pipe. ... Shell Scripting Recipes: ...
    (comp.unix.shell)
  • Re: Reordering/Renumbering files
    ... On 2006-09-21, Schraalhans Keukenmeester wrote: ... While the ordering remains the same, i.e. all files in original series01 ... AFAIK the rename command has no numbering capabilities. ... Shell Scripting Recipes: | My code in this post, if any, ...
    (comp.os.linux.misc)
  • Re: count of files
    ... I am using RHEL v 4.1. ... Is there any command to get the count of files ... the best way to do it will depend on your exact ... Shell Scripting Recipes: | My code in this post, if any, ...
    (comp.unix.programmer)
  • Re: Reordering/Renumbering files
    ... While the ordering remains the same, i.e. all files in original series01 ... AFAIK the rename command has no numbering capabilities. ... All you need is filename expansion (a.k.a. ... Shell Scripting Recipes: | My code in this post, if any, ...
    (comp.os.linux.misc)