G Nagasri Varma has asked for the wisdom of the Perl Monks concerning the following question:
1.
HDCS9-156039439P:defunct abc$ ls -ltr total 320 drwxr-xr-x 2 abc staff 68 Jan 28 12:46 1082970465 -rwxrwxrwx 1 abc staff 33 Jan 28 12:47 DEFUNCT.txt drwxr-xr-x 3 abc staff 102 Jan 28 13:20 search_data -rwxrwxrwx 1 abc staff 0 Jan 28 13:29 1087016121 -rw-r--r-- 1 abc staff 155236 Jan 28 13:33 output_defunctusers_move +ment.txt -rwxrwxrwx 1 abc staff 680 Jan 28 13:33 data.pl drwxr-xr-x 2 abc staff 68 Jan 28 13:42 1078036045
3.HDCS9-156039439P:defunct abc$ cat DEFUNCT.txt 1087016121 1082970465 1078036045
4.HDCS9-156039439P:defunct abc$ cat data.pl #!/usr/bin/perl open $outputfile, ">>","output_defunctusers_movement.txt" or die "$0: +open : $!"; $count=0; open(DATA, "</Users/abc/defunct/DEFUNCT.txt") or die "Couldn't open fi +le /Users/abc/defunct/DEFUNCT.txt ,$!"; @lines= <DATA>; for ($i=0;$i<=$#lines;$i++) { print $lines[$i]; `mv /Users/abc/defunct/"$lines[$i]" /Users/abc/defunct/search_data`; $count++; print $outputfile "$count . Successfully moved file : $lines[$i] \n"; } close(DATA) || die "Coulnt close file /Users/abc/defunct/DEFUNCT.txt p +roperly";
Why is the move command not working? I need a solution without modules. Folders do exists but why is it showing an error no such file or directory?1087016121 mv: rename /Users/abc/defunct/1087016121 to /Users/abc/defunct/search_data/1087016121 : No such file or directory 1082970465 mv: rename /Users/abc/defunct/1082970465 to /Users/abc/defunct/search_data/1082970465 : No such file or directory 1078036045 mv: rename /Users/abc/defunct/1078036045 to /Users/abc/defunct/search_data/1078036045 : No such file or directory HDCS9-156039439P:defunct abc$
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: System Command mv not working - Require a solution without modules.
by Corion (Patriarch) on Jan 28, 2016 at 08:38 UTC | |
by G Nagasri Varma (Novice) on Jan 28, 2016 at 08:47 UTC | |
by Corion (Patriarch) on Jan 28, 2016 at 08:56 UTC | |
|
Re: System Command mv not working - Require a solution without modules.
by 2teez (Vicar) on Jan 28, 2016 at 08:57 UTC | |
|
Re: System Command mv not working - Require a solution without modules.
by Discipulus (Canon) on Jan 28, 2016 at 08:40 UTC | |
|
Re: System Command mv not working - Require a solution without modules.
by Anonymous Monk on Jan 28, 2016 at 09:22 UTC |