From f63406bc3e5a871703bc5fc9f08f64a2373ab899 Mon Sep 17 00:00:00 2001 From: Cedric Dufour Date: Fri, 4 Sep 2015 11:09:39 +0200 Subject: [PATCH] Lock file --- cheat/cheatsheets/bash | 3 +++ 1 file changed, 3 insertions(+) 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'