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

Página superior
Adjuntos:
Obtener este mensaje como un correo
+ (text/plain)
Eliminar este mensaje
Responder a este mensaje
Autor: Dale Farnsworth
Fecha:  
A: plug-discuss
Cc: 
Asunto: 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