![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to use sed or perl command to find and replace a directory in a file | wip_vasikaran | UNIX for Dummies Questions & Answers | 1 | 08-20-2008 07:22 AM |
| Please Help. Strings in file 1 need to be searched and removed from file 2 | mjs3221 | Shell Programming and Scripting | 4 | 08-18-2006 04:13 PM |
| file restoration to new directory - tar command | newbie168 | UNIX for Dummies Questions & Answers | 2 | 07-19-2006 09:41 PM |
| after init all /tmp file has been removed | yesthomas | SUN Solaris | 5 | 12-06-2005 06:48 AM |
| Copying file names returned from a grep command into another directory | Kartheg | UNIX for Dummies Questions & Answers | 4 | 11-17-2005 12:34 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
cp && rm command, rm: <file> not removed. No such file or directory
Hi, I am running this is korn shell Code:
cp $source/$fname $dest/dir && rm $source/$fname This was returned: Code:
rm: /dir/file not removed: No such file or directory The file could be found in the $dest directory which meant the cp was success. The above code is used in a for loop to move many files This script could run properly in another box with the same solaris OS but could not work properly on this box. Is there something wrong with the command or is there something I missed out? Please help |
|
||||
|
Quote:
Code:
cd $source for fname in `ls` do cp $source/$fname $dest/dir && rm $source/$fname done There are no funny characters in the filenames.. Last edited by Leion; 01-20-2009 at 01:49 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|