Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!hacgate!lori From: lori@hacgate.scg.hac.com (Lori Barfield) Newsgroups: comp.sys.apollo Subject: Handy Aegis Script Message-ID: <6527@hacgate.scg.hac.com> Date: 20 Dec 89 19:49:00 GMT Organization: Hughes Aircraft Company, El Segundo CA Lines: 85 At the group where I used to work, we used Danford's FSE (Full Screen Edit) program to emulate the DM on VT100 terminals talking to Apollos over SIO lines. (This is a very cost-effective way to expand your net if you have users who don't require graphics applications all the time.) Our users usually named files with common extensions, like '.ftn', '.lis', '.out', etc. Why type the extension if you can have a shellscript smart enough to find the file you are looking for in less time than the typing would take? Also, it's a small thing, but this editor didn't prompt for creation of a new file; so in case of typos, you had to sit and wait for the empty file to come up, then exit. Annoying on a serial line; this was the fix. ---------------------------------- cut here ---------------------------- # E # enhanced call to serial line editor (see variable below) # # takes up to 2 args # if both args entered, 1st must be file name, 2nd must be -termtype # single argument can be either file name or -termtype # if term type ommitted, sends editor the default param (see var below) # # extension handling # if file name taken literally is nonexistent (or not ascii), looks for # file name + common suffixes (see list below for hierarchy) # # new file handling # if given file and all file.suff don't exist, prompts for creation # of new file ############################################################################# # eon # #=========================== CONSTANTS TO MODIFY ========================== editor := '/com/fse' def_term := '-vt100' suff_list := '.pas .ddl .ftn .ins.pas .ins.ftn _maint.pas _rpt.pas ' + @ '.lst .jcf .jlf .fmt .rpt .rdl .dat .c .ins.c' #============================================================================ # dash := '-'; file := ''; trm := ''; p1 := ''; fnd := true; type := '' args '' # if not eqs ^1; then # {assign 1st arg to correct var} p1 := ^1; for lett in ^p1 by char; exit; endfor if ((^lett = ^dash)) then trm := ^p1 else file := ^p1 endif # if not eqs ^file; then if existf ^file then # {check file type} /com/ld ^file -ab -nhd | read -type string type if (( ^type <> 'asc' )) then fnd := false endif else fnd := false endif # if ((not ^fnd)) then # {check for file + suffixes} for suff in ^suff_list by word if existf ^file^suff then file := ^file^suff fnd := true exit endif endfor endif # if ((not ^fnd)) then # {prompt for creation of new file} read -prompt "Create ^1? " -type string ans; args '' for yes in 'y Y yes YES Yes' by word if ((^ans = ^yes)) then fnd := true; exit endif endfor endif endif endif # if ((^fnd)) then # {set default terminal if necessary} if eqs ^2; then if ((^trm = '')) then trm := ^def_term endif else trm := ^2 endif # if eqs ^file; then # {can't call editor w/nul param; omit} /com/fse ^trm else ^editor ^file ^trm endif endif