[CentOS] Basic Bash Script Question
Philippe Naudin
philippe.naudin at supagro.inra.frMon Feb 21 10:47:24 UTC 2011
- Previous message: [CentOS] Basic Bash Script Question
- Next message: [CentOS] Basic Bash Script Question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le lun 21 fév 2011 10:31:38 CET, James Bensley a écrit:
> I'm stuck trying to work this one out and my Google skills are
> apparently lacking today.
>
> This is a test bash script;
>
> #!/bin/bash
>
> do something | tee a.log
>
> if [ $? -ne 0]; then
> echo broken
> fi
What about :
{ do something ; RETCODE=$? ; } | tee somefile
echo $RETCODE
--
Philippe
- Previous message: [CentOS] Basic Bash Script Question
- Next message: [CentOS] Basic Bash Script Question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list