Identifying the interactive shell and logon startup scripts

Earnie Boyd earnie_boyd@yahoo.com
Thu Aug 10 11:50:00 GMT 2000


Ok, I've done some preliminary work on this and posting for comments.

1) tcsh uses /etc/csh.login for it's login script as well as ~/.login and
~/.cshrc as well as some other possibilites based on ENV and DEFAULT_ENV. 
Logon processing can be started by `tcsh -l'.

2) ksh uses /etc/profile and ~/.profile for it's startup scripts.  Logon
processing can be started by `ksh -l'.

3) bash uses /etc/profile and [~/.bash_profile or ~/.profile] for it's startup
scripts.  Logon processing can be started by 'bash --login'.

4) a/sh - based on the strings in the executable would use /etc/profile and
~/.profile but I can't figure out how to do the logon processing.

5) zsh will use a various number of files depending on what the name of the
file is used to start the process.  It tries to emulate sh, ksh and csh as well
as it's own variation.  For the sake of this document will assume that the name
of zsh is zsh and will process /etc/zprofile and ~/.zprofile upon logon which
can be had by `zsh -l'.

As one can tell it should be easy enough to properly set such things that are
shell dependent such as the prompt string by having the appropriate files in
place.  So for bash's PS1 variable it should be set in ~/.bash_profile and the
~/.bashrc file should source ~/.bash_profile, for tcsh the prompt variable
should be set in the ~/.cshrc file, etc.

If you need to know what shell is running the following should suffice:

THISSHELL=`set | grep -i version | cut -c1-4 | tr 'A-Z' 'a-z'`
if [ -z $THISSHELL]; then 
  THISSHELL=ash_; 
fi

Cheers,

=====
---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://gw32.freeyellow.com/ >
           __Minimalist GNU for Windows__
  Mingw32 List: < http://www.egroups.com/group/mingw32/ >
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list