![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problems with a script that outputs data to a file | joeribut | Shell Programming and Scripting | 1 | 10-30-2008 01:54 PM |
| Expect script with file input problems | meberline | Shell Programming and Scripting | 1 | 05-29-2008 05:40 PM |
| Strange difference in file size when copying LARGE file.. | 0ktalmagik | Filesystems, Disks and Memory | 1 | 06-03-2006 08:34 PM |
| Problems with Copying Directory | brudnerx | UNIX for Dummies Questions & Answers | 3 | 01-12-2006 02:04 PM |
| copying files and Renaming them + shell script | pathanjalireddy | Shell Programming and Scripting | 7 | 06-08-2005 05:08 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Having problems copying a file from a script
Hello. Complete newbie over here, and I'm hoping you can help me out with this problem. The script copies a file to a directory within my home dir. Permissions are ok and the source file exists. If I execute the cp command from the command line or hardcode the path/file name, it works. (lines ommited for readability) Code:
fileName=$1 source="/p/cpt/validation/HS/cpt/models/"$fileName"/rtl/cpt/dangling/list.report" destination="~/averdugo/CPT_FILES/"$fileName".txt" cp $source $destination I think the problem is with the fileName variable because when I execute the program with sh -x option, I see: Code:
+ source=/p/cpt/validation/HS/cpt/models/v081023/rtl/cpt/dangling/list.report + destination=~/averdugo/CPT_FILES/v081023.txt + echo /p/cpt/validation/HS/cpt/models/v081023/rtl/cpt/dangling/list.report /p/cpt/validation/HS/cpt/models/v081023/rtl/cpt/dangling/list.report + echo '~/averdugo/CPT_FILES/v081023.txt' ~/averdugo/CPT_FILES/v081023.txt + cp /p/cpt/validation/HS/cpt/models/v081023/rtl/cpt/dangling/list.report '~/averdugo/CPT_FILES/v081023.txt' cp: cannot create regular file `~/averdugo/CPT_FILES/v081023.txt': No such file or directory As you can see from the statements above, there are single quotes around the destination variable '~/averdugo/CPT_FILES/v081023.txt' I have no idea where they came from. ![]() All your help is much appreciated. Angel |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|