-4

I have a function ff in 1.sh with exit status 33. When I call this function in 2.sh and call function ff and if the exit status is 33, then my 2.sh is broken. How can I do a continue step? like this:

if [ exit_of_ff -ne 0 ]
then
 continue
fi
jub0bs
  • 60,866
  • 25
  • 183
  • 186
avsun
  • 1
  • 1

2 Answers2

1

Not really an answer but a formatted comment.

If you have

ff() {
    if [ some_condition ]; then
        return 33
    fi
    return
}

Then, normally to check the error condition, you would do

if ! ff; then
    echo function ff returned non-zero
    exit
fi
echo function ff returned success

If you want to store the return status

ff
status=$?
if [[ $status -eq 33 ]]; then ...
glenn jackman
  • 238,783
  • 38
  • 220
  • 352
-1

I solved this issue like this:

if ( ff $parameter ) then ff $parameter fi

in ff I have 3 parameters which are not accessible after ( )

avsun
  • 1
  • 1