help: preserving error return codes thru function codes

help: preserving error return codes thru function codes

Post by Nick Abs » Thu, 28 Nov 1996 04:00:00



f_exit()
{
        # status of script providing input ?
        status=$?

        if [ $status -ne 0 ];then
                # (show the sccs dir path supplied to the script
                # rather than the absolute pathname)
                sed -e "s#$SCCSDIR/#$ERR_SCCSDIR/#" >&2
        else
                sed -e "s#$SCCSDIR/#$ERR_SCCSDIR/#"
        fi

        exit $status

Quote:}

get -r$VER -e "${SCCSDIR}/${SCCSFILE}" 2>&1 | f_exit
---------------------------------------------------------------------------------------------
The generic f_exit function is supposed to exit with the exit code
generated by the get command - it doesn't. Any ideas how to get round
this?
TIA
Nick
 
 
 

help: preserving error return codes thru function codes

Post by Ale » Fri, 29 Nov 1996 04:00:00



>f_exit()
>{
>        # status of script providing input ?
>        status=$?
>[...]
>get -r$VER -e "${SCCSDIR}/${SCCSFILE}" 2>&1 | f_exit
>---------------------------------------------------------------------------------------------
>The generic f_exit function is supposed to exit with the exit code
>generated by the get command - it doesn't. Any ideas how to get round
>this?

Didn't try it out but what about: [...] 2>&1 | f_exit $?
And then in the function:  status=$1

Alex

 
 
 

1. Return Code or Error Code with patches

Did somebody know's where i can find the doc with all the return code "failed" when you install somes patches ???

i just remember the return code "25" need a previous patch

Thank's in advence !
****************************************************
Eric Chamberland
Ingenieur de systemes
Centre de recherche du CHUL
2705 Blv laurier
Ste-Foy,Que
G1V 4G2

tel: (418) 656-4141 ext 6331
Fax: (418) 654-2761

2. MAC Filtering from Public to Trusted Side of Router???

3. Returning an exit code with the PID as an exit code

4. Adaptec 152X questions

5. Help: Returning a return code to a program

6. So, this Open Source thing ...

7. workable gnomemeeting to netmeeting connections

8. HELP: fsck returned error code

9. Making KShell return code error from SQLPLUS error

10. HELP: fsck returned error code - REBOOT NOW!

11. return code from piped function

12. accessing function return codes in korn...