Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

with that, I think if the cp fails, the rm will still be deleted. maybe 'set -euo pipefail' will fix it. Do the $1 and $2 need to be quoted too incase there are special characters?


Yes all that is true -- it was just a quick demonstration.

By the way:

- Oil has set -euo pipefail on by default. (And also nullglob)

- Oil doesn't split words by default, so you don't need the quotes: https://www.oilshell.org/release/0.8.0/doc/simple-word-eval....

Those are all "opt in" -- OSH still runs POSIX shell scripts, if you want all the extra ceremony :)




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

Search: