[wellylug] a bit of awk

E.Chalaron e.chalaron at xtra.co.nz
Mon Mar 22 15:31:54 NZST 2004


Hi there

I am writing my first script with awk 
I'd like to assign a field value returned by awk to $location

Of course the following does not work... though the line 
find -path '*.doc' | awk --field-separator=/ '{print $3}' 

displays the proper value.

Any help somebody ?
Thanks a lot
Edouard

#!/bin/bash
 IFS=$(echo -e "\n\r\t")
 for nom_file in `find /home -path '*.doc'`;
 do
     find /home -path '*.doc' | awk --field-separator=/ '{$3}'=$location
     catdoc "${nom_file}" > "/home/$location/$(basename ${nom_file} .doc).txt"
 done




More information about the wellylug mailing list