Re: using echo 'text' > file (to add to last line of several…

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
Slet denne besked
Besvar denne besked
Skribent: Dale Farnsworth
Dato:  
Til: plug-discuss
CC: 
Emne: Re: using echo 'text' > file (to add to last line of several documents)
> Although the for loop will probably work for your PHP files, I generally
> prefer using a different method for processing lists of files.
>
> /bin/ls *.php | while read i ; do echo "text" >> $i ; done


Using "while read" is a good idea but this still doesn't properly handle
filenames with spaces. Try this instead:

    /bin/ls -1 *.php | while read i; do echo "text" >> "$i"; done
---------------------------------------------------
PLUG-discuss mailing list - 
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss