--- ray/src/px/ran2tiff.csh 2005/09/17 05:14:14 2.1 +++ ray/src/px/ran2tiff.csh 2008/08/25 04:50:32 2.3 @@ -20,6 +20,10 @@ while ("$argv[1]" =~ -*) breaksw case -D: shift argv + if (! -d $argv[1]:q ) then + echo "Directory $argv[1] does not exist" + exit 1 + endif set outdir=$argv[1]:q/ breaksw case -h*: @@ -61,8 +65,7 @@ if ($#argv < 2) then exit 1 endif # Get shrunken image luminances -set vald=/tmp/val$$ -mkdir $vald +set vald=`mktemp -d /tmp/val.XXXXXX` foreach inp ($argv:q) set datf="$inp:t" set datf="$vald/$datf:r.dat" @@ -104,5 +107,7 @@ foreach inp ($argv:q) | ra_tiff $tfopts - $outp:q mv $vald/{,old}histo.dat end -if ($?histof) cp -f $vald/oldhisto.dat $histof +if ($?histof) then + cp -f $vald/oldhisto.dat $histof +endif rm -rf $vald