|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
This might be something really trivial, but drives me mad...
Please copy the following little script into a shell file and run it! #dont' worry about these lines, just setting up the environment I heve here... mkdir ./test\ \(\ something\ \) touch ./test\ \(\ something\ \)/a.txt echo ./test\ \(\ something\ \) > file_list DIR=`cat ./file_list` #Here is the problem: echo -ne $DIR/a.txt '\x00' $DIR/b.txt | xargs -0 -n2 cp #I receive the following error message: #cp: cannot stat `./test ( something )/a.txt ': No such file or directory Any idea why the cp command does not work??? Any help would be appreciated!! Sandor Laza |
|
|||
|
Try:
echo -ne $DIR/a.txt'\x00'$DIR/b.txt | xargs -0 -n2 cp |
|
|||
|
A much simpler solution might be:
cp "$DIR/a.txt" "$DIR/b.txt" |
|
|||
|
[qu ote name='ken_yap' date='Jan 6 2008, 01:16 AM' post='221548']
A much simpler solution might be: cp "$DIR/a.txt" "$DIR/b.txt" [/quote] Thank you for the help, it works now! The Quotation marks were really needed becouse the shell collapsed the multiple spaces to one without them... I always learn something new...
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|