home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / shell / 3907 < prev    next >
Encoding:
Text File  |  1992-09-11  |  931 b   |  40 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!rpi!masscomp!peora!tarpit!fang!gator!rde!tssi!unlinfo.unl.edu!unlinfo!lappala
  3. From: lappala@unlinfo.unl.edu (Kris Lappala)
  4. Subject: HELP w/ ex
  5. Message-ID: <1992Sep10.132256.24519@unlinfo.unl.edu>
  6. Keywords: HELP w/ ex editor
  7. Sender: news@unlinfo.unl.edu
  8. Nntp-Posting-Host: unlinfo.unl.edu
  9. Organization: University of Nebraska - Lincoln
  10. Distribution: g
  11. Date: Thu, 10 Sep 1992 13:22:56 GMT
  12. Lines: 26
  13.  
  14. I am using the ex editor in a shell program and need to suppress the 
  15. interactive feedback to the user. Here is a copy of my code:
  16.  
  17. CSHRC=/tmp/cshrc
  18.  
  19. string="`grep $1 ${CSHRC}`"
  20.  
  21. if [ -z "$string" ]
  22. then
  23. echo "setenv $1 $2" >> ${CSHRC}
  24.  
  25. else
  26. ex - | -s  ${CSHRC}  <<-end_of_edit
  27. /setenv *$1
  28. d
  29. i
  30. setenv $1 $2
  31. .
  32. w
  33. q
  34. end_of_edit
  35.  
  36. fi
  37.  
  38. if anyone can help with this problem please write.
  39. thanks  lappala@cse.unl.edu
  40.