4 ms·
That's not as simple or clear as you make it sound though. http://mywiki.wooledge.org/BashFAQ/105 http://mywiki.wooledge.org/BashFAQ/105 disagrees and refers
by darklajid 12y ago
That's not as simple or clear as you make it sound though.
http://mywiki.wooledge.org/BashFAQ/105 http://mywiki.wooledge.org/BashFAQ/105
disagrees and refers to GreyCat's preference not to use -e at the bottom of the list of 'complications'.
- un1xl0ser 12y agoFrom the same page:"rking's personal recommendation is to go ahead and use set -e, but beware of possible gotchas. It has useful semantics, so to exclude it from the toolbox is to give into FUD." You can use set -e, and turn it off (set +e) for code blocks and things that are problematic. He could also add '|| true', and you may be able to use colon to avoid point problems without turning everything off. These are edge cases and you can easily work around them if you an advanced user. If you are not an advanced user then you should certainly use -e.
- un1xl0ser 12y ago$ diff -u /tmp/a /tmp/b --- /tmp/a 2015-03-24 08:33:00.021919797 -0400 +++ /tmp/b 2015-03-24 08:33:05.629963015 -0400 @@ -1,5 +1,5 @@ #!/usr/bin/env bash set -e i=0 -let i++ +let i++ || true echo "i is $i" $ /tmp/a $ /tmp/b i is 1 $