Hacker News new | past | comments | ask | show | jobs | submit login

No it won't. set -e is implicit disabled for the first command with && and ||. Same for a command after if/while/until and after !. It should only matter if you implicit return immediately after.

  $ bash -ec 'if [ 1 = 2 ]; then echo true; fi; echo $?'
  0
  $ bash -ec '[ 1 = 2 ] && echo true; echo $?'
  1
In both cases it does not quite and execute the last echo.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: