Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 06-03-2010, 01:32 AM   #1
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 just blank....

How to aechieve it ??
Old 06-03-2010, 06:31 AM   #2
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora, PCLinuxOS
Posts: 684

Rep: Reputation: 95
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.


copy, file, from, location, path

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 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 03:43 PM
copy vid tape to file and burn file to DVD jim mann Linux - Software 4 01-24-2006 10: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 12:39 PM
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 07:24 PM
How do I redirect something to a file without it overwriting the destination file??? nikold01 Linux - General 8 09-09-2004 03:30 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:00 PM.

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