[GLLUG] why doesn't this work?

Mike Rambo mrambo at lsd.k12.mi.us
Thu Oct 23 18:54:41 EDT 2003


I'm trying to combine the text of all files in a directory into one
large file with the one liner:

for TARGET in `ls | awk {'print $9'}`; do cat $TARGET >> makeAll.mysql;
done;

but all I get is:

cat: building.mysql: No such file or directory
cat: dept.mysql: No such file or directory
cat: equipment.mysql: No such file or directory
cat: guest.mysql: No such file or directory
cat: inventory.mysql: No such file or directory
cat: itech.mysql: No such file or directory
cat: itstaff.mysql: No such file or directory
cat: partused.mysql: No such file or directory
cat: repair.mysql: No such file or directory
cat: vardat.mysql: No such file or directory

The $TARGET variable clearly contains all the filenames in the directory
but the cat command for some reason can't find them in this context.
What have I missed?

I know that I can do the same thing one file at a time (and probably
will shortly) but I'd sure like to know why this doesn't work.

Thanks.


-- 
Mike Rambo
mrambo at lsd.k12.mi.us

NOTE: In order to control energy costs the light at the end 
of the tunnel has been shut off until further notice...



More information about the linux-user mailing list