[wellylug] a bit of awk

Jonathan Harker jharker at massey.ac.nz
Tue Mar 23 11:17:02 NZST 2004


andrej at paradise.net.nz wrote:

> Quoting "E.Chalaron" <e.chalaron at xtra.co.nz>:
> 
> 
>> find /home -path '*.doc' | awk --field-separator=/ '{$3}'=$location
> 
>   find /home -path '*.doc' | $location=`awk --field-separator=/ '{print $3}'`
> 
> Try that ....

should be this (note the missing $).

find /home -path '*.doc' | location=`awk --field-separator=/ '{print $3}'`


Perhaps more useful is:

   for f in `find /home -path '*.doc'`
   do
     location=echo $f | awk --field-separator=/ '{print $3}'

     # ... other stuff here

   done





More information about the wellylug mailing list