a.sh
1 #/bin/sh 2 echo "haha"; 3 exit 1;perl脚本22 my $output=qx(sh a.sh);
23 my $exitcode=$?; 24 $exitcode>>=8; 25 print "output=$output\n"; 26 print "exitcode=$exitcode\n"; 27 system("pwd"); 28 print STDERR "$0 has finished,congratulations!\n"; 29 print STDERR "Time elapsed:".(Time::HiRes::time-$tmStarted)."\n";
http://www.docin.com/p-56464488.html