On 26-Feb-2002 Guido 'lenix' Boehm wrote: > Hey, > >> Here's an update to the previous script based on the feedback >> received. I've attempted to make the script somewhat more shell >> neutral. > > thanks a lot, runs very nice now :) > >> Please let me know of any problems you encounter. > > just one little thing i doesn't really care about but could > mention here: > on freebsd it's /usr/bin/mktemp instead of /bin/mktemp. > maybe you could use 'whereis' or 'which' to figure out, > but i have no idea if this fits the standard. >
create_tempfile() { if `type tempfile 2>&1 >/dev/null`; then THETMP=`tempfile --prefix=bsetbg` elif `type mktemp 2>&1 >/dev/null`; then THETMP=`mktemp -t bsetbg` else THETMP=/tmp/.bsetbg.$$ if [ -f $THETMP ]; then rm -f $THETMP fi touch $THETMP chmod 600 $THETMP fi TMPFILE=$THETMP } This is the code currently used by the cvs version of bsetbg (no I have no included cthulhain's new version yet).