Hpda@hplabs.UUCP (HP Data Systems) (03/24/84)
Index: /usr/src/ucb/sendbug/sendbug.sh Description: I hate vi(1). I resent being thrown into it when reporting a bug. Repeat-By: % sendbug See vi ? Fix: replace the line... /usr/ucb/vi /tmp/bug$$ with... if ( $VISUAL != "" ) then set editor = $VISUAL else if ( $EDITOR != "" ) then set editor = $EDITOR else set editor = /usr/ucb/vi endif $editor /tmp/bug$$ Comments: Repent. Learn EMACS.
joe@fluke.UUCP (Joe Kelsey) (04/06/84)
Sendbug is also a 'csh' script. This causes problems if your subject line happens to contain any special characters - $, ~, etc. csh will barf if you try to post a message to net.bugs.4bsd with one of these characters in the subject line. All distributed shell scripts should use the Bourne shell. csh is an absolutely horrible programming language and should only be used for an interactive shell!!! /Joe
liberte@uiucdcs.UUCP (04/24/84)
#R:vax4:-150900:uiucdcs:8200018:000:765 uiucdcs!liberte Apr 23 16:53:00 1984 The previous suggestion to check $EDITOR and $VISUAL rather than always using vi has a problem. In checking them, they must already be defined. Use the following instead: replace the line... /usr/ucb/vi /tmp/bug$$ with... if ($?VISUAL) then set editor = $VISUAL else if ($?EDITOR) then set editor = $EDITOR else set editor = /usr/ucb/vi endif $editor /tmp/bug$$ I also noticed that an expression such as: if ($?VISUAL && $VISUAL == "vi") echo It works. doesnt work. Although the manual says: "the operators are similar to those of C," full expression evaluation is used and an error is given if $VISUAL is not defined. Daniel LaLiberte, U of Illinois, Urbana-Champaign, Computer Science {moderation in all things - including moderation}
chris@umcp-cs.UUCP (04/26/84)
Another glaring example of why one shouldn't use the C shell to write shell scripts. ${VISUAL-${EDITOR-vi}} /tmp/bug$$ in the Bourne shell will do just what is desired. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland