#!/usr/bin/env osh : : osh - " Force sh(1), csh(1), and other shells to exit w/ error! " <'' ;;; : : " @(#)$Id: 92934b6bce1e91f042c7d82127ea5bd6e5e7f2ee $ " : : " The author of this file, J.A. Neitzel , " : " hereby grants it to the public domain. " : : : " Make or check/remake OSHDIR ($d) in the environment. " : : " usage: source /path/to/oshdir $$ (to make) " : " or: " : " usage: oshdir (to check) " : : " Check for correct usage. " : >>$0'' <'' ; killer $0 oshdir : >>$1'' <'' ; : >>$$'' <'' if $# = 1 -a X$1 = X$$ goto Make if $# = 0 -a X$d = X \ if { exit } perror $0 '"OSHDIR not set - do source "'$0'" $$"' if $# = 0 goto Check pusage source $0'" $$ (to make)"' fd2 -e echo ' or:' pusage $0 '"(to check)"' ; exit : Make if X$d != X goto Check if ! { mkdir -m 0700 /tmp/osh-$u-$$ } if { exit } false setenv OSHDIR /tmp/osh-$u-$$ : fallthrough : Check - " And remake the directory if it does not exist. " if ! -e $d -a ! -h $d if ! { mkdir -m 0700 $d } if { exit } false if ! -d $d -o -h $d if { exit } perror $0 $d'": Not a directory"' : zero status