How to evaluate if the previous command has failed in csh?

-1

I have a script that executes several commands. And there is one that I want to verify if it has failed and if so, show a message and finish.

In bash I would use $?

What do I have to use in csh?

    
asked by Jose Antonio Dura Olmos 26.01.2017 в 09:13
source

1 answer

0

In csh you can use $ status

comando1
if ( $status != 0 ) then
  echo "Ha fallado el comando1"
  exit 1
endif
comando2
    
answered by 26.01.2017 / 09:13
source