On Fri, 5 Jan 2001, YL Narayana wrote:
> Hi.
>
> I have a large number of small files. I need to insert/append the name of
> each file into the body of the file. How can I do it easily?
>
The simplest command line (in bash) would be:
for i in *
do echo -en $i >> $i;
done
That would append the filename to the file. Instead of '*' you can use any
pattern. If you have directories while expanding '*', u'd see errors.
If you want a still elegant solution, u can use perl. If u need a script,
let me know.
Sreeji
----------------------------------------------
Find out more about this and other Linux India
mailing lists at http://lists.linux-india.org/