A few questions

Jonathan I. Kamens jik at athena.mit.edu
Mon Dec 17 09:32:53 AEST 1990


In article <1990Dec13.182425 at Informatik.TU-Muenchen.DE>, knott at Informatik.TU-Muenchen.DE (Thomas Knott) writes:
|> If the first line in your shell script looks like
|> 
|> #!/bin/sh
|> 
|> then the shell processing your script is the Bourne-shell sh, which should
|> be in /bin. This also works in the .login, .logout and .profile, I guess.

  To be blunt, get a clue.  Or, at the very least, actually TRY things you're
not sure about before you post messages like this to the net.

  No, this will NOT work.  The .login and .profile files are executed WITHIN
the login shell, not in a subshell.  They are not invoked as separate
processes, which is when the #! notation takes effect, they are read and
executed within the shell that is reading them.

  Just think about this for a minute.  The stuff in your .login or .profile
file is supposed to affect your login shell.  If the #! notation in .login or
profile were to work, then it would cause the .login or .profile file to be
executed in a separate shell, i.e. a separate process, which means that the
commands executed would NOT affect the login shell.  This sort of defeats most
of the purpose of .login or .profile.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.shell mailing list