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