0

for (( v=0; v<t ; v++ ))
do
awk '/TRAP-TYPE/{i++}i' $fname >tron
if [ "$?" -eq 0 ]
then
echo "MIB file found"
else
t=$t-1
fi

some other commands
echo "MIB not in directory"
done

When the awk '/TRAP-TYPE/{i++}i' $fname >tron fails I want it to skip some other commands and reach directly the end of the code and just print MIB not in directory.

What can I do to do this? Bash doesn't have goto.

1

I would just move some other commands between echo "MIB file found" and else.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.