[geeks] ksh for loop question

Greg A. Woods woods at weird.com
Fri May 10 17:00:59 CDT 2002


[ On Friday, May 10, 2002 at 19:40:47 (+0200), Jochen Kunz wrote: ]
> Subject: Re: [geeks] ksh for loop question
>
> On 2002.05.10 17:54 Brian Hechinger wrote:
> 
> > for files in `cat file_list.txt`; do
> >   wget "http://www.server.com/$files"
> > done
> One file per line? 
> if [ x$ANSWER = "xYES" ] ; then
> 	cat file_list.txt | while read a ; do wget "$a" ; done
> fi

Once again someone uses an extra 'cat' process!  (and an extra test too!)

Sometimes I wonder if maybe 'cat' should never have been implemented.
It would be just as easy to replace its true purpose with an "append"
option to 'dd'.  Then all you budding shell programmers would be forced
to learn to do things correctly.  :-)

-- 
								Greg A. Woods

+1 416 218-0098;  <gwoods at acm.org>;  <g.a.woods at ieee.org>;  <woods at robohack.ca>
Planix, Inc. <woods at planix.com>; VE3TCP; Secrets of the Weird <woods at weird.com>



More information about the geeks mailing list