LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-03-2010, 12:32 AM   #1
bluepenguine
LQ Newbie
 
Registered: Mar 2008
Posts: 16

Rep: Reputation: 1
Unhappy copy the file whose source path is mentioned in a file to the specified Destination


Hello , Is there any who can help me !!!
I had a situation in which the the path of the file to be copied is written in other file and I had to copy it using shell script...for eg

Consider I have to copy /home/robert/temp to /media/sda1 but the location of source /home/robert/temp is specified in location.txt which is present in /home/robert/location.txt

I can use cp $(cat /home/robert/location.txt) /media/sda1 on normal linux shell

But I am using buildroot script where $(cat /home/robert/location.txt) evaluate to nothing..is just blank....

How to aechieve it ??
 
Old 06-03-2010, 05:31 AM   #2
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
When you run the script, are you sure location.txt has anything in it?

I'm not familiar with buildroot, but maybe your script is running before location.txt is generated or populated.

Also, there could be a path or shell problem. Try replacing cat with /bin/cat.
 
  


Reply

Tags
copy, file, from, location, path



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy last 10000+ lines of large text file to a temporary file emilyg Linux - Newbie 3 06-24-2009 02:43 PM
copy vid tape to file and burn file to DVD jim mann Linux - Software 4 01-24-2006 09:57 PM
Is arrangement of file systems will differ if we copy a file from FAT 32 to ext 3 ? anindyanuri Linux - Software 2 02-20-2005 11:39 AM
Fresh Suse 9.1 trying to install VMWare 4.5.1 - Unable to copy the source file DeathCab for 2D Linux - Software 2 10-14-2004 06:24 PM
How do I redirect something to a file without it overwriting the destination file??? nikold01 Linux - General 8 09-09-2004 02:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:02 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