Re: [newbie] How to copy and paste many command at once ?
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Thu, 28 Sep 2006 13:14:14 -0400
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
.
- References:
- [newbie] How to copy and paste many command at once ?
- From: vd12005
- [newbie] How to copy and paste many command at once ?
- Prev by Date: Re: Remove the first 3 characters after reading each line
- Next by Date: Re: Date from the time stamp
- Previous by thread: Re: How to copy and paste many command at once ?
- Next by thread: Stored procs from tcl
- Index(es):
Relevant Pages
|