[X-Unix] Bash scripting Question

Eric F Crist ecrist at secure-computing.net
Wed Aug 23 04:36:33 PDT 2006


On Aug 22, 2006, at 10:52 PM, Stroller wrote:

>
> On 23 Aug 2006, at 04:17, Eric F Crist wrote:
>> ...
>> I would ask first if there is a different exit code for someone  
>> being connected and nobody being connected.  You can check this by  
>> running fmsadmin and ...  After it executes, type "echo $?" at the  
>> command line (minus the quotes).
>
> I wondered this, but I believe that programs should return an  
> exitcode of 0 if they are successful, non-zero only as an error  
> condition.
>
> Whilst exit codes can be useful to determine WHY a command has  
> failed (because the file tested doesn't exist, because you don't  
> have permission to access it, because the parameters applied are  
> invalid, &c &c) I assumed that `fmsadmin` would believe its job to  
> be done correctly whether it reported no clients or a number of  
> them connected. I would anticipate it would exit 0 in either case.
>
> Stroller.

But look at a simple program like ping.  You get an exit code of 0 if  
it successfully pings the host in question, and exit code of 2 if the  
host doesn't reply.

I assume that perhaps fmsadmin may operate in a similar manner.
-----
Eric F Crist
Secure Computing Networks




More information about the X-Unix mailing list