rovf has asked for the wisdom of the Perl Monks concerning the following question:
The only purpose of systemx is to show the command being executed. Now create some text file, say: abc.bat, and execute it like this:# This is program omoshiroi.pl use strict; use warnings; sub systemx($) { my $cmd=shift; print "EXECUTING: $cmd\n"; system $cmd; } my $tmpfh=$ARGV[0]; systemx("dir $tmpfh"); systemx("type $tmpfh"); systemx("cmd /c type $tmpfh");
On my system, the output looks like this:omoshiroi.pl abc.bat
As you can see, dir can find the file, cmd /c type can find the file, but type can't find it. Strange, isn't it?H:\tmp>omoshiroi1.pl abc.bat EXECUTING: dir abc.bat Datenträger in Laufwerk H: ist CIFS.HOMEDIR Datenträgernummer: 0000-0000 Verzeichnis von H:\tmp 15.05.2008 14:00 65 abc.bat 1 Datei(en) 65 Bytes 0 Verzeichnis(se), 1.239.298.048 Bytes frei EXECUTING: type abc.bat abc.bat not found EXECUTING: cmd /c type abc.bat pwd . $HOME .bash_profile echo $PATH sview fischron_exp_dv ls -a
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Windoze oddity?
by BrowserUk (Patriarch) on May 15, 2008 at 15:49 UTC | |
|
Re: Windoze oddity?
by ikegami (Patriarch) on May 15, 2008 at 15:28 UTC |