Languages and Scripting

Execute ".login" startup file when the "csh" shell is ran

 
SOLVED
Go to solution
JoseLuis2
Occasional Contributor

Execute ".login" startup file when the "csh" shell is ran

Hi,

Why doesn't execute ".login" startup file when the "csh" shell is ran?

 

 

 

tehpu067::/var/opt/aat/a/hp> uname -a
HP-UX tehpu067 B.11.00 U 9000/800 144454651 unlimited-user license
tehpu067::/var/opt/aat/a/hp> cat .cshrc
#!/usr/local/bin/tcsh
#
# Default user .cshrc file (/usr/bin/csh initialization).

# Usage:  Copy this file to a user's home directory and edit it to
# customize it to taste.  It is run by csh each time it starts up.

# Set up default command search path:
#
# (For security, this default is a minimal set.)

        set path=( $path )

# Set up C shell environment:

        if ( $?prompt ) then            # shell is interactive.
            set history=20              # previous commands to remember.
            set savehist=20             # number to save across sessions.
            set system=`hostname`       # name of this system.
            set prompt = "$system \!: " # command prompt.

            # Sample alias:

            alias       h       history

            # More sample aliases, commented out by default:

            alias     d       dirs
            # alias     pd      pushd
            # alias     pd2     pushd +2
            # alias     po      popd
            # alias     m       more
        endif

tehpu067::/var/opt/aat/a/hp>
tehpu067::/var/opt/aat/a/hp> cat .login
#!/usr/local/bin/tcsh

echo "============================"
echo "Running .login for HPEMSM1 account ."
echo "============================"
set path=( $path )
stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z" hupcl ixon ixoff tostop
# Set up shell environment:
set noclobber
set history=32000
setenv CCHOME /home/hpemsm1/ccmngr/ccgnrl/v06
setenv CCMNGRHOME /home/hpemsm1/ccmngr
setenv PATH ${PATH}:$CCHOME/bin:/home/hpccmngr/ccgnrl/v06/bin
source $CCMNGRHOME/config/.ccmngr_cshrc
source $CCMNGRHOME/config/.ccmngr_login
setenv ORACLE_SID HPFASTD0
setenv TMPDIR /var/opt/aat/d/hp/shr/ems/tmp
setenv SHLIB_PATH /opt/cobol/lib:${ORACLE_HOME}/lib
source .alias

bindkey "^R" i-search-back

tehpu067::/var/opt/aat/a/hp> csh
tehpu067 21: echo $CCHOME
CCHOME: Undefined variable.

 

 

 

Thanks in advance!

Regards, Jose Luis

 

1 REPLY 1
Steven Schweda
Honored Contributor
Solution

Re: Execute ".login" startup file when the "csh" shell is ran

> Why doesn't execute ".login" startup file when the "csh" shell is ran?

   Assuming the usual stuff about file ownership and permissions, I'd
expect "csh" to "source" the "~/.login" file, _if_ "csh" is run as a
login shell.

> tehpu067::/var/opt/aat/a/hp> csh

   Not run as a login shell.  Try "csh -l"?

      man csh   # Look for "login".


> [...] It is run by csh each time it starts up.

   Note that, of the two files, only the ".cshrc" template says that.