newlisp获得bash该命令的退出状态
2015-08-15 12:51
369 查看
newlisp exec你可以运行bash命令。但如何返回状态来运行它?
特别是,我需要监控hdfs dfs -test 结果返回。经过一番摸索,我发现了一个简单的答案:
输出结果:
特别是,我需要监控hdfs dfs -test 结果返回。经过一番摸索,我发现了一个简单的答案:
#!/usr/bin/newlisp (set 'x (exec "hdfs dfs -test -d /user/chenshu;echo $? ")) (println "x: " x) (exit)
输出结果:
x: ("0")
相关文章推荐
- bash常用
- Xshell配置ssh免密码登录-密钥公钥(Public key)与私钥(Private Key)登录
- 利用Shell脚本进行文件内容去重
- 利用Shell脚本进行文件内容去重
- BASH
- XShell5 连接虚拟机上的Lunix
- Linux Shell脚本编程初体验
- shell 分割字符串存至数组
- 插入排序(直接插入和Shell排序)
- Windows Powershell 3 极速入门
- 推荐一款 chrome SSH 插件 - Secure Shell
- Bash - 趣味Shell
- shell中截取字符串方法总结
- shell中截取字符串方法总结
- shell中截取字符串方法总结
- shell中截取字符串方法总结
- shell中截取字符串方法总结
- shell中截取字符串方法总结
- shell中截取字符串方法总结
- shell中截取字符串方法总结