How to find the return value of last executed command in UNIX?

前端 未结 1 1256
花落未央
花落未央 2020-12-29 03:15

How to find the return value of last executed command in UNIX?

1条回答
  •  长情又很酷
    2020-12-29 03:51

    You can use the shell variable $?

    Such as:

    $ true ; echo $?
    0
    $ false ; echo $?
    1
    

    0 讨论(0)
提交回复
热议问题