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

posted on 2012-04-16 17:42  finallyly  阅读(415)  评论(0编辑  收藏  举报