Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#569 System command for cygwin

open
nobody
Core (65)
5
2009-10-27
2009-10-27
Anonymous
No

This is a minor bug that can be bypassed:

system command are not supported if you are using perl interpreter from cygwin using EPIC eclipse pluggin:

my $res1=`pwd`;
print "$res1\n";
my $res2=`ls -la`;
print "$res2\n";

This program gives the following output:

Can't exec "pwd": No such file or directory at /cygdrive/c/te/test.pl line 5.
Use of uninitialized value $res1 in concatenation (.) or string at /cygdrive/c/te/test.pl line 6.
Can't exec "ls": No such file or directory at /cygdrive/c/te/test.pl line 7.
Use of uninitialized value $res2 in concatenation (.) or string at /cygdrive/c/te/test.pl line 8.

To bypass this issue, the only way I find is :

open(TOTO, "|c:/cygwin/bin/bash.exe --login");
print TOTO 'pwd;';
print TOTO 'ls -la;';
close TOTO;

Both of these scripts are running fine if there are called directly from cygwin shell.

It is another story if you want to grab the output...

Regards,
Pascal
toto0038@yahoo.fr

Discussion

  • Jan Ploski
    Jan Ploski
    2010-04-04

    I suppose that you could also set the PATH environment variable in the launch configuration.