Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.shell Subject: Re: A few questions Keywords: shell Message-ID: <1990Dec16.223253.7311@athena.mit.edu> Date: 16 Dec 90 22:32:53 GMT References: <1990Dec11.202750.2435@wpi.WPI.EDU> <1990Dec13.182425@Informatik.TU-Muenchen.DE> Sender: news@athena.mit.edu (News system) Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 28 In article <1990Dec13.182425@Informatik.TU-Muenchen.DE>, knott@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@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710