script formatting question?

Robert Dege rdege at cse.Buffalo.EDU
Mon Apr 22 11:30:40 EDT 2002



Pipe your find results into `tr`, and have it remove any spaces, then pipe
it into your awk.  Either that or you can use sed to replace any
whitespace into another character so that it doens't break your awk.

-Rob

> 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
>
>



Dege

So Many Things in Life Would Be Really Funny
.... If They Weren't Happening To Me



More information about the nflug mailing list