Is there a way to make my bash script complete in the first command that returns a non-zero status?
I know that I can simply associate it with && as follows:
&&
cd /stuff && echo 'what up' && ....
Is there another way?
Yes, it's as simple as adding at the beginning of your script after shebang:
set -e
You can stop this if you want (just a piece of code) with
set +e
or on shebang:
#!/bin/bash -e
or by calling a script with:
bash -e script.bash
Source: https://habr.com/ru/post/1443572/More articles:UITableView - when scrolling too quickly, the contents of the last cell replace the first cell - iosCreating MySQL Variable Table Naming - mysqlQuote query macro reader - macrosStyle Tags at Perplexed Tags - cssHow to open a project in Package Explorer for Eclipse - eclipseIs there a limit on the length of field values ββin mango queries? - mongodbORA-03113 in code. In addition, TNS-12535 and ORA-03137 in the alert file - oracle11gDatepicker for Bootstrap (select "Only a week" and enable it in IE) - javascriptRack: multiple session cookies for a single rack application - ruby ββ| fooobar.comHow to use scipy.integrate to get the volume of a truncated sphere? - pythonAll Articles