Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 May 2001 10:29:06 -0400
From:      Daniel Frazier <dfrazier@magpage.com>
To:        Eric Boucher <eric_boucher60@yahoo.com>
Cc:        FreeBSD <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Prog.: Knowing the exit code in command line
Message-ID:  <3B0531B2.4655BDE1@magpage.com>
References:  <20010518141010.32324.qmail@web9406.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Eric Boucher wrote:
> 
> Hi there,
> 
> I wanted to know something. I remember that somebody
> told me that there were a way to know what is the exit
> code a command line return. For exemple, imagine that
> I've just type the command "ls -l" in a shell, if I
> want to know the integer that Unix just return after
> doing that command, what can I do? I think it's a
> simple command with the "$" symbol, but I didn't
> remember it.
> 

assuming bash or sh... echo $? will do the trick.

-- 
----------------------------------------------------------------------
Daniel Frazier  <dfrazier@magpage.com>   Tel:  302-239-5900 Ext. 231
Systems Administrator                    Fax:  302-239-3909
MAGPAGE, We Power the Internet           WWW:  http://www.magpage.com/

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
        - Benjamin Franklin, Historical Review of Pennsylvania, 1759.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B0531B2.4655BDE1>