Homework, eh? Well, here's a few *hints*, then.
Processes (or commands) are executed in the context of a shell.
Therefore, it's the shell that has the exit status of the process. You
need to find out just how to query the shell for that.
Look in the 'bash' manpage (or docs) and search for the various
automatically defined environment variables. Some of them include $#
which says how many command line args are used in a script and $@ which
is the args list. The variable to return the exit status is something
like those.
On Apr 19, 2004, at 10:44 PM, Michael wrote:
> uptime will "ONLY" tell me how long the system has been up since last
> reboot. Where did that come from?
>
> Registered linux user # 348490
> http://counter.li.org/
>
> ----- Original Message -----
> From: "David Huerta" <huertanix@elysium.arete.cc>
> To: <plug-discuss@lists.plug.phoenix.az.us>
> Sent: Monday, April 19, 2004 5:18 PM
> Subject: Re: command question
>
>
>> "uptime" should do the trick.
>>
>> --
>> + David "Huertanix" Huerta
>> + DeVry Linux User Group
>> + http://www.devrylinux.org
>>
>> On Mon, 19 Apr 2004, Mike wrote:
>>
>>> I hate to ask home work questions, but I simply can not find my
>>> answer
> in
>>> notes.. What command would one use to print the exit status of the
>>> last
>>> command executed?
>>> I am thinking it uses a | but I can not find the answer anywhere.
>>> Thanks
> in
>>> advance.
>>> --
>>> 2:39pm up 124 days 21:52, 3 users, load average: 0.35, 0.41,
>>> 0.23
>>> Linux
>>>
>>> ---------------------------------------------------
>>> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
>>> To subscribe, unsubscribe, or to change you mail settings:
>>> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>>>
>> ---------------------------------------------------
>> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
>> To subscribe, unsubscribe, or to change you mail settings:
>> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>>
>>
>
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss