in reply to Re^2: Semicolon behaviour in system call
in thread Semicolon behaviour in system call
Indeed... but what's the equivalent in a system call?
system takes a shell command, so the equivalent of
echo "1 & echo 2 & echo 3" & echo two dos & echo t
using system is
system('echo "1 & echo 2 & echo 3" & echo two dos & echo t');
Do you realize you are launching a Windows build of Perl (ActivePerl or Strawberry Perl?), and that Windows build of Perl launch cmd rather than (non-existent) /bin/sh? In other words,
is the same assystem('pwd; pwd');
system('cmd', '/x', '/c', 'pwd; pwd');
Perhaps you are looking for
# Adjust the path for your system system('c:\\progs\\cygwin\\bin\\sh', '-c', 'pwd; pwd');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Semicolon behaviour in system call
by casual_prgmr (Initiate) on Mar 28, 2014 at 18:16 UTC |