in reply to Re^2: perl - bash script problem
in thread perl - bash script problem
If the rest of the script does stuff that depends crucially on what your current working directory is (before and/or after running "cvs diff"), you just need to add:chdir $wrPath; my $failed = system( "cvs diff >> $reportsPath/diffReport.txt" ); if ( $failed ) { warn "cvs diff returned non-zero exit status $failed\n"; }
use Cwd; my $origpath = getcwd; # before doing 'chdir $wrPath' ... chdir $origpath; # after doing 'system( "cvs diff ..." )'
|
|---|