diff options
Diffstat (limited to 'example.bash')
-rwxr-xr-x | example.bash | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/example.bash b/example.bash new file mode 100755 index 0000000..970b095 --- /dev/null +++ b/example.bash @@ -0,0 +1,14 @@ +#!/bin/bash + +# acquire the inhibition +exec 9> >(./inhibit-screensaver bash-inhibitor-example testing) + +# do work +echo Working... +sleep 10 + +# still works if we die +kill -9 $$ + +# otherwise, uninhibit like so (or just exit) +exec 9>&- |