Path: utzoo!hoptoad!mejac!decwrl!ucbvax!agate!ig!uwmcsd1!leah!itsgw!nyser!cmx!jerryp From: jerryp@cmx.npac.syr.edu (Jerry Peek) Newsgroups: alt.sources Subject: Re: hold -- a program to buffer input Message-ID: <590@cmx.npac.syr.edu> Date: 8 Aug 88 14:29:46 GMT References: <8082@watdragon.waterloo.edu> <4623@whuts.UUCP> Reply-To: jerryp@cmx.npac.syr.edu (Jerry Peek) Distribution: alt Organization: Northeast Parallel Architectures Center, Syracuse NY Lines: 52 [Sorry for posting this. Mail to him bounced.] In article <4623@whuts.UUCP> wsd@whuts.UUCP (54299-DINSMORE,W.S.) writes: > > Would someone please me a way to do this in the C_Shell? Here it is. --Jerry Peek, Northeast Parallel Architectures Center, Syracuse, NY jerryp@cmx.npac.syr.edu +1 315 443-1722 ----- CUT HERE ----------------------------------------------------------- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # hold.csh # This archive created: Mon Aug 8 10:26:18 1988 export PATH; PATH=/bin:$PATH if test -f 'hold.csh' then echo shar: will not over-write existing file "'hold.csh'" else cat << \SHAR_EOF > 'hold.csh' #! /bin/csh -f if ( $#argv > 1 ) then # USE sh TO PUT ERROR ON stderr: sh -ce "echo 'Usage: hold [file]' 1>&2" exit 1 endif onintr cleanup set f=/tmp/hold.$$ cat > $f switch ($#argv) case 0: cat $f; breaksw case 1: cat $f > "$1"; breaksw endsw cleanup: /bin/rm -f $f exit 0 SHAR_EOF chmod +x 'hold.csh' fi # end of overwriting check # End of shell archive exit 0