[ale] help with a tiny shell script - correction

Christopher Bergeron christopher at bergeron.com
Tue Nov 16 13:26:28 EST 2004


Fletch wrote:

>>>>>>"Christopher" == Christopher Bergeron <christopher at bergeron.com> writes:
>>>>>>            
>>>>>>
>
>    Christopher> Correction: the for line should read: for i in `\ls
>    Christopher> *.csv`; do cat $i >> append.csv; echo -e "\n" >>
>    Christopher> append.csv; done (for i in backtick backslash ls
>    Christopher> start dot csv backtick semicolon ...)
>
>Using ls to generate a list of files from the list of files the glob
>your shell just expanded is kind of pointless (akin to a useless use
>of cat :), and on some platforms with enough matching files ls might
>fail if expands into too many arguments.  Just say:
>
>
>for i in *.csv ; do
>  # ... 
>done
>
>
>and let the shell do its thing.
>  
>
Yeah, I just noticed that.  It was late at night when I wrote the 
original email.  I guess yesterday was just a long day.

-CB




More information about the Ale mailing list