home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / question / 10450 < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.8 KB  |  39 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!pbhya!dbsuthe
  3. From: dbsuthe@pbhya.PacBell.COM (Daniel B. Suthers)
  4. Subject: Re: how come : ! out of vi always uses sh instead of $SHELL ???
  5. Reply-To: dbsuthe@PacBell.COM (Daniel B. Suthers)
  6. Organization: Pacific * Bell, San Ramon, CA
  7. Date: Thu, 27 Aug 1992 23:27:56 GMT
  8. Message-ID: <1992Aug27.232756.17980@pbhya.PacBell.COM>
  9. References: <fish.714853851@news2.gsfc.nasa.gov> <857@hq.dla.mil>
  10. Lines: 27
  11.  
  12. fish@daacdev1.stx.com writes:
  13. >: whenever i :! out of vi it uses /bin/sh instead of $SHELL
  14. >: so all of my aliases are lost, etc and makes it very limited
  15.  
  16.  
  17. Checking the source for VI on our SVR3 machine shows that VI uses the
  18. execl(2) call to run sub-shells.  It incorrectly uses the hardcoded 
  19. string "sh" as the second argument to that call.  This means that the
  20. shell you use THINKS it was invoked as "sh", as this is what's in ARGV[0].
  21.  
  22. It actually uses whatever is in your (vi) shell variable.  This variable is
  23. loaded from a getenv() call and possibly overwritten by your EXINIT string.
  24.  
  25. Now, to address the complaint: Aliases are lost because aliases are not
  26. passed to child processes.  This applies to Bourne and KSH.  I don't
  27. know about CSH.
  28.  
  29. My solution is to have all of my aliased commands backed up as shell
  30. commands.  This allows a reasonable environment whether in a subshell or
  31. not.
  32.  
  33. Daniel B. Suthers,  CCP
  34. Technology Consultant, PCS & IN Development Lab,        Pac*Bell
  35. Voice: (510) 671-1325               UUCP:  dbsuthe@Pacbell.COM
  36. ================================================================================
  37. =  Commit unexpected kindnesses and senseless acts of beauty.                  =
  38. ================================================================================
  39.