Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Why does system("mv $x $y") not work when it works at the command line?

by Cody Fendant (Hermit)
on Feb 03, 2023 at 01:18 UTC ( [id://11150107] : perlquestion . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ### I run this from the command line:
    /usr/bin/perl mover.pl The.Rookie.S05E14.720p.HEVC.x265-MeGusta[eztv.r
    +e].mkv
    
  2. or download this
        unless ( -e $ARGV[0] ) {
            die("$ARGV[0] doesn't exist");
        }
    
  3. or download this
        say "move command: 'mv $ARGV[0] ./r/'";
        system("mv $ARGV[0] ./r/");