script formatting question?

Joe josephj at main.nc.us
Tue Apr 23 14:43:46 EDT 2002


I'm pretty rusty with awk, but one thing you can play with is FS= which
allows you to tell awk to use any characters of your choice for field
separators (i.e. not blanks).  I know this won't solve the problem, but it
might help.

Joe (formerly from Buffalo)
----- Original Message -----
From: "Darin Perusich" <Darin.Perusich at cognigencorp.com>
To: <nflug at nflug.org>
Sent: Monday, April 22, 2002 11:04 AM
Subject: script formatting question?


> hello,
>
> i'm beating myself up trying to figure this out and i need some outside
> input.
>
> i'm trying to do a recursive search of a filesystem for all documents
> with a certain extension, *.doc, *.xls ./etc. when i get this list i
> need the following inforamtion about those files:
>
> name size(in bytes) /path/to/file
> ---- -------------  -------------
> darin 64000 myresume.doc
>
> i accomplish by:
>
> find /home/darin -name "*.doc" -exec ls -l {} \;  \
> |awk '{print $3 FS $4 FS $8}'
>
> the problem i'm running into is files with spaces in the name, i.e my
> resume 2000.doc. since awk uses space and tab as the field seperator you
> don't get the full path of the file just up to the space.
>
> i'm sure that there's an easy way to accomplish this in perl, but since
> i don't know much, next to nothing about perl i'm stuck.
>
> any ideas?
>
> for those that are interested i'm writing a script that bulk loads
> binary files into a mysql driven document management systems, sdms
> (simple document mangement system).
>
> --
> Darin Perusich
> Unix Systems Administrator
> Cognigen Corp.
> darinper at cognigencorp.com




More information about the nflug mailing list