On Thu, Jun 12, 2003 at 08:05:48PM +0200, Olivier Wirz wrote:
> Hello,
> 
> I would like to know if there is a way to check $? to see whether the 
> programm ran correctly in such a statement:
> 
> @results =`grep $search $_`;
$exitcode=$?;

And there you have it, $exitcode is your exit code.

I was given this answer by David van der Geer, who used:

$exit_value = $? >> 8;

I'm not sure what " >> 8 " means though, anyone?

Also when I asked this Steve Grazzini advised:

<quote>
Nick Drage <[EMAIL PROTECTED]> wrote:
>                                                                                      
>    
> How do I capture the output and the exit code of a process?                          
>    
> Basically I'm looking to combine the functionality of backticks                      
>    
> and the system call.                                                                 
>    

Use backticks; and the wait() status that system returns
will be in $?.
</quote>

-- 
 
?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to