`
haohappy2
  • 浏览: 325956 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

C-Shell “Variable syntax” problem

 
阅读更多

“Varible syntax” problem cause the shell can't return the value properly.

 

#!/bin/csh
set php_path = '/usr/bin/php'
$php_path test.php $argv
exit $?

  when you run this shell

system("test > test.log", $ret);

  the $ret is always 1, and run the real shell, there is varible syntax at the last. and it cause the the $ret value is always 1, And find if the shelll is C-shell, the return value capture return should be "$status" not "$?", after update the script, everything works fine

#!/bin/csh
set php_path = '/usr/bin/php'
$php_path test.php $argv
exit $status

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics