#!/bin/sh # # Routine called by others which outputs the full path of the # temporary work space. # if [ -x /bin/echo ] then Echo=/bin/echo elif [ -x /usr/bin/echo ] then Echo=/usr/bin/echo else Echo=echo fi if [ x$TMPDIR = x ] then TMPDIR='No/Temp/Dir/Env/Defined/This/Time' fi # # Pick largest work area available # Must be larger than 200 MB # max=200 d1='' [ -d /spool/$USER ] && d1=/spool for dir in ${d1} ${TMPDIR} /usr/tmp /tmp do [ -d ${dir} ] || continue x=`df -m ${dir} | tail -1` set ${x} if [ ${4} -gt ${max} ] then work=${dir} max=${4} fi done if [ x$work != x ] then if [ ! -d $work/$USER ] then mkdir $work/$USER fi fi if [ -d $work/$USER ] then $Echo $work/$USER else $Echo '' fi