PERL中对SHELL命令的调用细节
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://dannyyuan.blog.51cto.com/212520/47916 |
PERL中对SHELL命令的调用细节
在PERL开发中,通常可以用system函数或 ``操作符来执行系统命令,但注意对 alias, bg, bind, break, builtin, cd, command, compgen, complete, continue, declare, dirs, disown, echo, enable, eval, exec, exit, export, fc, fg, getopts, hash, help, history, jobs, kill, let, local, logout, popd, printf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test, times, trap, type, typeset, ulimit, umask, unalias, unset, wait等shell内部命令(即在文件系统中无执行文件的命令)这样直接执行会出错,错误是无法找到该文件或目录。可以在命令前加sh –c来实现。而对cd、umask等SESSION型命令,应该用PERL的内部函数chdir、umask等来实现功能更可靠。本文出自 “守望者的技术日记和六味生活” 博客,请务必保留此出处http://dannyyuan.blog.51cto.com/212520/47916 本文出自 51CTO.COM技术博客 |



dannyy1026
博客统计信息
热门文章
最新评论
友情链接