shell - '$?' 在 shell 脚本中是什么意思?

标签 shell unix

我遇到了一个包含如下语句的 shell 脚本,

if [ $val -eq $? ]

什么$?这里的意思?

最佳答案

我发现link非常有用,是很好的答案。它包括用 sample 清楚地表达。

enter image description here

关于shell - '$?' 在 shell 脚本中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12741710/

相关文章:

Shell 脚本 : Execute command after running "exit" command in the shell script

linux - 如何永久存储文本模式浏览器的代理信息(例如链接)

c++ - 轮询 STDIN 和其他 Fds

shell - 在shell中执行umask命令时返回的002值是什么意思

c - 应用程序如何从 stdin 读取行而不消耗管道中现有的缓冲数据?

linux - Shell 文件解析以自动上传 youtube

linux - 连接文件夹中的大量文件时参数列表太长

shell - 如何根据条件为awk的输出着色

regex - 使用egrep检查字符串的长度

c - 在 Unix 上输出自制合成声音的简单方法是什么?