-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This is also easy, but once Robert Citek sees this he'll whip you up a
nice fat script, but this will cover the first part in the interim. I
don't think cat is as smart as you are making it...you have it confused
with -exec in find. That option doesn't exist in cat.
Put this in a file called foo
#foo script
#!/bin/bash
filelist=$1
while read line
do cp -rv $line /home/dwg
done < $filelist
then chmod 755 foo and run it against your list
./foo filelist2
I'm going to sleep
Bryan
nj462SUT wrote:
| I am trying to copy a bunch of drawings on a client's machine,
| starting in a particular directory, so I started by making a list of
| all the files with the following command:
|
| find ./ -iname "*.dwg" -print > /tmp/filelist1
|
| Then I edited the file, removing lines of files that I didn't need to
| copy, and saved it as, say, /tmp/filelist2. I made sure the file
| worked by typing cat /tmp/filelist2, and then I made a directory to
| put the copied drawings into: mkdir /home/dwg
|
| Now I want to read through the lines of files in "filelist2" and copy
| the files into the new directory. The best I can come up with is
|
| cat /tmp/filelist2 -exec cp '{}' /home/dwg ';'
|
| but I get a switch error for the cat command. I'm looking for a
| command line solution, but I think this may require a shell script,
| but I'm at a loss on where to start to get that working. I'm not
| worried about the files having duplicate names, but I suppose a
| solution that takes that into account couldn't hurt.
|
| I don't have access to the machine right now, and I forgot to write
| down the specific error (I know, but I was in a rush). I'm not looking
| for a perl or awk solution, because I don't know if the client has
| those packages installed, and it's a stand-alone machine, so kinda
| handcuffed there. Any ideas?
|
| -nj462SUT
|
| |
- --
A healthy diet includes Linux, Linux and more Linux.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFI4vevh+MLjl5SKYQRAltCAJ9tPM/cTTQ82Y9MQUot5DdM9IKxNwCghxQE
MKC/NaH6D04AS5pFbbw/Ofw=
=/djj
-----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [EMAIL PROTECTED]
For more options, visit our group at
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---