sfdisk -D $val << EOF
,,$type
EOF
How can I check its status after execution? Not via if…$?, but by disjunction ||.
What I mean is I can do the folllowing:
ls || exit 4
It will exit with code 4 if ls encountered error, but how can I do it in my example?
And the second question is, how can I perform multiple commands on failure? Is something like this Ok?
`ls` || { echo "!!!"; exit 4 }
Thank you!
You’re actually asking two different questions…
The answer to the first, is that you put the conditions after the << FOO part:
I’m using && here for convience to see the output. But with this command set:
You get:
Answering your second question, you should use ()s: