[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 怎样检查一个命令执行后的返回值?



Hi, "Vern Sun" <s5unty@gmail.com> :

On Thu, 8 Mar 2007 17:12:33 +0800
"Vern Sun" <s5unty@gmail.com> wrote:

> 我记得好像有一个系统变量记录了系统最后一次执行的命令的返回值
> 或者有其它什么方法可以显示某条命令执行后的返回值吗?比如这条命令:
> 
> 1$ /bin/sh -c "exec ls"
> 
> 谢谢!
> 

BASH 可以用 $?

-- 
A. Because it makes the logic of the discussion difficult to follow.
Q. Why shoudn't I top post?
A. No.
Q Should I top post?

A: Because it destroys the flow of the conversation
Q: Why is it bad?
A: No, it's bad.
Q: Should I top post in replies to mailing lists? 



Reply to: