#!/bin/sh -u # This script was originally written to be invokable by pine-3.95; some design # decisions were made to maximize the functionality of this script for `pine'. IFS=' ' # Better safe than sorry! debug=0 # 0 => no diagnostic displays to STDERR; # 1 => echo commands before executing them; # 2 => echo commands but do NOT execute them! #tmp=${TMPDIR:-'/usr/tmp'} # Directory for any needed temporary files ... #tmp=${TMP:-${TMPDIR:-'/usr/tmp'}} # [Honor `pgp's $TMP before $TMPDIR?] Basename='/bin/basename' # Where `basename' really lives ... Echo='/usr/ucb/echo' # Could be just `echo' if builtin ... Echo_n='/usr/ucb/echo -n' # ... what does `echo -n' (or just `echo'). Pgp='/usr/uucc/exec/pgp' # Where `pgp' really lives ... script=`$Basename "$0"` # Get our name (for diagnostic messages) if [ "$script" != 'pgp' -a -t 2 ] # and (if we weren't just invoked as `pgp') then # then (assuming an invocation from `pine') $Echo "$script" >&2 # say who we are ... $Echo >&2 # ... with blank line. fi if [ "$debug" -gt 0 ] then ### Debug ### $Echo $script debug: $0 ${1+"$@"} >&2 if [ "$debug" -lt 2 ] then $Echo $script debug: commands listed and then executed >&2 else $Echo $script debug: commands listed but not executed >&2 fi fi if [ "$debug" -gt 0 ] then ### Debug ### $Echo $script debug: $Pgp ${1+"$@"} >&2 status=$debug fi if [ "$debug" -lt 2 ] then $Pgp ${1+"$@"} # Invoke `pgp' (with any supplied arguments). status=$? fi if [ "$script" != 'pgp' -a -t 2 ] # If invoked as something other than `pgp', then # assume it's from something like `pine' $Echo_n "[^D to abort] OK? " >&2 # and give the poor user (me!) read ok