Return Value of a Command
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Return Value of a Command




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Return Value of a Command  
junky_fellow@yahoo.co.in


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-15-05 01:06 PM

When a command is executed from the shell (ksh), its return value
may be obtained by command "echo $?". This return value is equal to the
error no (errno) if any of the system call in the executed command
fails.
The shell and the command executed are two different processes,
then how the return value (error) of the command is known to
shell.
Also, in most of the programs I have seen if any of the system call
fails the program exits  with 1. So, during exit() also we are not
telling anyone about the errno.

Thanx in advance for any help ....






[ Post a follow-up to this message ]



    Re: Return Value of a Command  
Gregory Toomey


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-17-05 07:47 AM

junky_fellow@yahoo.co.in wrote:

> When a command is executed from the shell (ksh), its return value
> may be obtained by command "echo $?". This return value is equal to the
> error no (errno) if any of the system call in the executed command
> fails.
> The shell and the command executed are two different processes,
> then how the return value (error) of the command is known to
> shell.
> Also, in most of the programs I have seen if any of the system call
> fails the program exits  with 1. So, during exit() also we are not
> telling anyone about the errno.
>
> Thanx in advance for any help ....

Is this a question or a political statement?

gtoomey





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:43 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register