# HG changeset patch # User Mikael Berthe # Date 1270244720 -7200 # Node ID b6b45c2eb022c98c51a87f0381fd80de9486e9b2 # Parent 9798e3aaa85158a48b6af389bf9e234b5054050a [extsay] Improve script portability diff -r 9798e3aaa851 -r b6b45c2eb022 extsay-ng/extsay.sh --- a/extsay-ng/extsay.sh Fri Apr 02 23:23:58 2010 +0200 +++ b/extsay-ng/extsay.sh Fri Apr 02 23:45:20 2010 +0200 @@ -9,8 +9,11 @@ # MiKael, 2010-04-02 FIFOPATH="$HOME/.mcabber/mcabber.fifo" -tmpdir=${TMPDIR:="/tmp"} + +tmpdir=${TMPDIR:=$TMP} +tmpdir=${tmpdir:="/tmp"} editor=${EDITOR:="vi"} + jid="." # Use argument as a recipient JID, if it is provided @@ -19,7 +22,7 @@ # Leave if the FIFO is not available [ -p $FIFOPATH ] || exit 255 -tf=$(mktemp --tmpdir=$tmpdir extsay-XXXXXX) || exit 255 +tf=$(mktemp $tmpdir/extsay-XXXXXX) || exit 255 # This will not work if the editor runs in the background! $editor $tf @@ -30,5 +33,7 @@ echo $cmd >> $FIFOPATH fi -rm $tf +# Do not remove the file too soon +(sleep 20 ; rm $tf)& + exit 0