diff --git a/cheat/cheatsheets/bash b/cheat/cheatsheets/bash index c19f599..571b3ca 100644 --- a/cheat/cheatsheets/bash +++ b/cheat/cheatsheets/bash @@ -22,3 +22,6 @@ set +x # Retrieve N-th piped command exit status printf 'foo' | fgrep 'foo' | sed 's/foo/bar/' echo ${PIPESTATUS[0]} # replace 0 with N + +# Lock file: +( set -o noclobber; echo > my.lock ) || echo 'Failed to create lock file'