I have this bash script:
#!/usr/bin/env bash
function onqltrap {
echo "process with pid $$ was trapped.";
fle=$(echo "$(pwd)" | tr "/" _);
rm -f fle;
}
function qltrap {
trap onqltrap EXIT;
}
function qlstart {
set -e;
trap onqltrap EXIT;
mkdir -p "$HOME/.quicklock/locks"
fle=$(echo "$(pwd)" | tr "/" _)
mkdir "$HOME/${fle}.lock" || { echo "quicklock could not acquire lock."; exit 1 }
}
function qlstartold {
mkdir -p "$HOME/.quicklock/fifo"
rm "$HOME/.quicklock/fifo/$$.fifo"
mkfifo "$HOME/.quicklock/fifo/$$.fifo"
}
when I source this file in a script, I get this error:
bash: /Users/alexamil/WebstormProjects/oresoftware/quicklock/quicklock-trap.sh: line 28: syntax error: unexpected end of file
does anyone know why that error is happening?