Lock file

This commit is contained in:
Cedric Dufour 2015-09-04 11:09:39 +02:00
parent b3a93bc128
commit f63406bc3e
1 changed files with 3 additions and 0 deletions

View File

@ -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'