Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl chdir doesn't work

A previous post might be useful: Perl system() call failed with return code 65280

Again, I've used this code many times, but it doesn't work here. I've moved all other perl instances from PATH.

Source:

$targetDir = "M\:\\bldforge_AOMS_DEV";
print ("targetDir=$targetDir\n");

chdir($targetDir) or die "Cant chdir to $dir $!";
$current_dir = `cd`;
print "\nCurrent dir = $current_dir\n" 

Output:

Z:\>ccperl test.pl
targetDir=M:\bldforge_AOMS_DEV

Current dir =
like image 816
Alex Avatar asked May 01 '26 21:05

Alex


1 Answers

To be sure you are indeed in a ClearCase view, I would use cleartool pwd:

$current_dir = `cleartool pwd`;

That will work even on Windows:

The cleartool pwd command lists the current working directory.
This command is intended for use in interactive cleartool and multitool sessions, and in batch files or shell scripts that simulate interactive sessions.

like image 96
VonC Avatar answered May 03 '26 10:05

VonC