Added bash-support

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
2020-11-16 12:54:24 +01:00
parent 5b8989ac04
commit fc7dc3f34a
56 changed files with 12377 additions and 1 deletions

View File

@ -0,0 +1,17 @@
TMPDIR=${TMPDIR:-/tmp} # defaults to /tmp if unset
#-------------------------------------------------------------------------------
# Creates a particular temporary directory inside $TMPDIR.
#-------------------------------------------------------------------------------
TEMPORARY_DIR=$(mktemp -d "$TMPDIR/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") || \
{ echo "ERROR creating a temporary file"; exit 1; }
#-------------------------------------------------------------------------------
# When the program exits, it tries to remove the temporary folder.
# This code is executed even if the process receives a signal 1,2,3 or 15.
#-------------------------------------------------------------------------------
trap '[ "$TEMPORARY_DIR" ] && rm --recursive --force "$TEMPORARY_DIR"' 0
touch $TEMPORARY_DIR/tempfile # new tempfile inside folder