LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2004, 07:27 AM   #1
dominant
Member
 
Registered: Jan 2004
Posts: 409

Rep: Reputation: 30
copy many files stored in a file


I want to chroot my apache so i have to copy many files (filenames are stored in a file)

The file form is

Code:
open("/lib/libcrypt.so.1", O_RDONLY)    = 3
open("/usr/lib/libgdbm.so.3", O_RDONLY) = 3
open("/usr/lib/libgdbm_compat.so.3", O_RDONLY) = 3
So i want to copy all these files into the /chroot/httpd/
how can extract all these filenames from the above file and copy to the /chroot/httpd/ without receiving any error (directory automatic creation)?
 
Old 11-11-2004, 08:24 AM   #2
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
I don't have access to Linux right now, but here are some guidelines:

- use a while loop to go through the file
- cut -d" to separate the dir and file from the rest
- dirname and basename to separate directory from filename
- mkdir -p to create directory. if it already exists there will be an error, just ignore it
- cp file
 
Old 11-12-2004, 04:33 AM   #3
dominant
Member
 
Registered: Jan 2004
Posts: 409

Original Poster
Rep: Reputation: 30
How the cut works?

cut -d and then what? what delimiter to put there?
 
Old 11-12-2004, 05:49 AM   #4
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
cut -d\" -f2

means the second field delimited by " characters. The backslash is required to escape the special meaning of the quote.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy a file to mutiple files Radical-Rick Programming 6 07-11-2006 04:47 PM
Copy Data stored on MBR mrpc_cambodia Linux - General 3 12-19-2004 08:18 PM
How to do recursive file copy of directory for specific files? Arodef Linux - Newbie 4 06-29-2004 06:35 PM
copy multiple files into one file HelpPlease Programming 2 12-09-2003 03:36 PM
Where are programs files and configuration files stored? nutshell Linux - General 2 03-09-2002 11:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration