- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to copy files using inputfile with filenames
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2001 06:00 AM
тАО08-17-2001 06:00 AM
now i want to copy these files to a new directory. How can i do that
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2001 06:06 AM
тАО08-17-2001 06:06 AM
Re: how to copy files using inputfile with filenames
There are several ways to do this.
A script like this is one:
newdir=/destdir/dir1/dir2
cat filefile | while read fname
do
cp $fname ${newdir}/
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2001 06:06 AM
тАО08-17-2001 06:06 AM
Re: how to copy files using inputfile with filenames
If you have full paths to the files in your file you can do following:
for i in `cat /path_to_your_file`
do
cp $i /destination_path
done
Later,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2001 06:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2001 06:20 AM
тАО08-17-2001 06:20 AM
Re: how to copy files using inputfile with filenames
cat yourlist | cpio -ocB | (cd /otherdir ; cpio -icvdumB)
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2001 06:56 AM
тАО08-17-2001 06:56 AM
Re: how to copy files using inputfile with filenames
You can do
while read eachline;do
cp $eachline newdir
done
...BPK...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2001 02:45 PM
тАО08-18-2001 02:45 PM
Re: how to copy files using inputfile with filenames
on HPUX most seem to like "tar" more than "cpio", so
it would be something like
cd /source-dir
tar cf - < file.lst | (cd /dest-dir; tar xvf -)
or you could use "xargs" and an additional script like
this:
#!/usr/bin/sh
#copymany: copies all parameters to /dest-dir
cp $* /dest-dir
and then call this from within a line like this:
xargs copymany < file.lst
HTH,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2001 02:41 AM
тАО08-19-2001 02:41 AM
Re: how to copy files using inputfile with filenames
I'm not sure why you're working from a file of filenames, but try Bill Hassell's famous "puddle move":
cd /olddir
find . | cpio -pudlmv /newdir
If you need specific files, craft a -name argument for the find that will suit your needs.
And just my 2-cents' worth: I prefer cpio. Actually, I'd probably like pax the best if I'd ever take the time to learn the syntax.
All the best,
Jim