What is a good way to do general execs?

Michael Meissner meissner at osf.org
Thu Jun 14 08:05:47 AEST 1990


In article <3459 at auspex.auspex.com> guy at auspex.auspex.com (Guy Harris)
writes:

|  >|The Bourne shell sources ".profile" *only* for login shells (just as the
|  >|C shell sources ".login" only for login shells - the "-f" in
|  >|"#! /bin/csh -bf" is there to prevent it from sourcing your ".cshrc").
|  >
|  >Nope. For the man page for 'sh': 
|  > 
|  >     Invocation. 
|  >     If the first character of argument zero is -, commands are 
|  >     read from $HOME/.profile, if such a file exists.   
| 
| I consider "login shell" basically short for "shell with the first
| character of argument zero a '-'" (which means that any shell fired up
| by "login" is a login shell, but so are shells fired up by e.g.  "su"
| when run with the appropriate flag).  I considered the more detailed
| explanation unnecessary and extraneous in this case.... 

On the same thread, I sometimes want to create a login shell when I'm
not logging in, and not all shell's have a -login switch like bash
does.  You can get around this by symlinking the appropriate shell to
-<shell> in your executable directory, ie:

lrwxrwxr-x  1 meissner       19 Jun  2 14:11 -ksh -> /usr/bin/ksh
lrwxrwxr-x  1 meissner        7 May 16 15:13 -sh -> /bin/sh
lrwxrwxr-x  1 meissner        8 May 16 15:13 -sh5 -> /bin/sh5
--
Michael Meissner	email: meissner at osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA

Catproof is an oxymoron, Childproof is nearly so



More information about the Comp.unix.wizards mailing list