Eet vieet: Fixed to work on non-bash compat shells.

Thanks to Davide Andreoli for reporting and suggesting fixes.
This commit is contained in:
Tom Hacohen 2014-03-08 10:55:37 +00:00
parent a660bbe966
commit 561ea66dec
1 changed files with 4 additions and 4 deletions

View File

@ -1,19 +1,19 @@
#!/bin/sh #!/bin/sh
function cleanup() { cleanup() {
if [ ! -z "$TFILE" ]; then if [ ! -z "$TFILE" ]; then
rm "$TFILE" rm "$TFILE"
fi fi
} }
function die() { die() {
echo "$@" echo "$@"
echo "Aborting" echo "Aborting"
cleanup cleanup
exit 1 exit 1
} }
function usage() { usage() {
die "Usage: vieet <eet file> <section>" die "Usage: vieet <eet file> <section>"
} }
@ -21,7 +21,7 @@ if [ $# -ne 2 ]; then
usage usage
fi fi
if [[ -z "$EDITOR" ]]; then if [ -z "$EDITOR" ]; then
die "EDITOR env var must be set." die "EDITOR env var must be set."
fi fi