Bash Commands - $? for testing the result of a command
来源:互联网 发布:java实现导出excel表 编辑:程序博客网 时间:2024/05/17 04:01
$? is especially useful for testing the result of a command in a script .
#!/bin/bash
echo hello
echo $? # Exit status 0 returned because command executed successfully.
lskdf # Unrecognized command.
echo $? # Non-zero exit status returned because command failed to execute.
echo
exit 113 # Will return 113 to shell.
# To verify this, type "echo $?" after script terminates.
# By convention, an 'exit 0' indicates success,
#+ while a non-zero exit value means an error or anomalous condition.
- Bash Commands - $? for testing the result of a command
- An A-Z Index of the Bash command line for Linux.摘自https://ss64.com
- Linux Commands for Beginners--The top Command
- Linux Commands for Beginners--The Watch Command
- List of FTP commands for the Microsoft command-line FTP client
- Bash Commands - the diff of > and >> # Use I/O Redirection to generate a log file
- Linux Commands for Beginners-- Regular Expressions--the grep command
- 正则表达式学习指南(十九)----Testing The Same Part of a String for More Than One
- Read the result of DOS command in C++
- An error,A think of the conception of testing
- Command Line -- List of command line commands
- The classfy of testing
- The process of testing
- The future of testing
- Testing the Type of a File in Unix
- Testing & The Role of a Test Lead / Manager(转载)
- A question of Testing
- The Ethical Hack: A Framework for Business Value Penetration Testing
- X86指令
- android ListView内容无限循环显示
- webservice 关于PHP的使用
- dda
- java中删除文件夹或文件工具类
- Bash Commands - $? for testing the result of a command
- 目录路径
- nyoj 120 校园网络(强连通缩点+判断入度出度大小)
- 【原创】驱动中实现模拟键盘按键
- SSO简介
- GBK字符集碰到的问题
- 黑马程序员____类
- Tarjan求有向图的强连通分量(Tarjan算法描述)
- JAVA中类型后面跟三个点