Source .login

Hello,
I am trying to update the .login file via "source .login" after adding an alias. However, I am getting this error:

bash-3.2$ source .login
bash: .login: line 83: syntax error: unexpected end of file

The last line of the file is nothing more than:
##################

The new alias that was added also does not work. I am using X11 on a MacBook Pro (Lion OS).

Thanks!

It is highly likely that you have an if without a closing fi, a do without a closing done, a ( without a matching ), a { without a matching }, or an opening quote without a closing quote somewhere in the updates you made. If you can't find it when you look at it again, post the whole file and we'll be glad to try to help you find the problem.

Thanks.... below is the file:
____________

############   SAMPLE .LOGIN FOR USERS ON SCIENCES.SDSU.EDU   ##########
if ($TERM != "sun") then
set noglob; 
eval `tset -s -Q -m "unknown:?vt100"  -m "dialup:?vt100" -m "network:?vt100"`;
unset noglob
endif
# To be able to run things from the current directory (but a potential security
# risk):
#set path = (. $path )
##############
# The following lines set/reset the delete/backspace characters):
##stty werase '^W'
#stty erase '^?'
#stty erase '^H'
##############
# The following sets default file protection; don't ask what the "77" means!
umask 77
############
set ignoreeof
set noclobber
#     permit or deny messages
mesg y
#     biff - give notice of incoming mail messages
biff n
#
# Change the prompt to the user's name:
set me="Devilboy-ro"
set prompt=`hostname | awk -F. '{print $1}'`
set prompt="`echo $me`> "
################ alias commands
alias pi 'ssh -Y palex71@pisco.sdsu.edu'
alias pa 'ssh -Y palexb@palexbooks.com'
alias sc 'ssh -Y pbrogna@sciences.sdsu.edu'
alias pif 'sftp palex71@pisco.sdsu.edu'
alias paf 'sftp paleqikt@server65.web-hosting.com'
alias scf 'sftp pbrogna@sciences.sdsu.edu'
# For safety:
alias rm 'rm -i'
alias mv 'mv -i'
alias cp 'cp -i'
#
# For convenience and shotcuts:
alias d 'ls -l'
alias dir 'ls -l'
alias ll 'ls -la'
alias netscape 'netscape &'
#
alias grace '/opt/grace/bin/xmgrace &'
#
# Set other useful commands options:
alias ping '/usr/sbin/ping'
alias df 'df -k'
alias du 'du -k'
alias grep 'grep -i'
##################
# Environment variables
#  and shortcuts to directories 
# For example, "> cd $TMP2" will do this: "> cd /iraftmp/iraftmp2/"
# (note: you have to use the "$" symbol before the environment variable)
setenv TMP2  /iraftmp/iraftmp2/
setenv TMP3  /iraftmp/iraftmp3/
setenv EDITOR emacs
#
####
# Important to limit coredumps, or you may write huge core dump files every
# time you encounter a bug.
limit coredumpsize 0
#
##################
# For using PGPLOT
#setenv PGPLOT_FONT /opt/lib/pgplot/grfont.dat
#setenv PGPLOT_DIR  /opt/lib/pgplot
#setenv PGPLOT_DEV  /XSERVE
#
# Note: to link with pgplot on sciences:
#  -L/opt/local/pgplot -lpgplot\
#  -L/usr/local/X11R6/lib -lX11\
#        or
#  -L/opt/lib/pgplot -R/opt/lib/pgplot -lpgplot \
#  -lX11 \
##################

Are you trying to source a csh script on a bash?
Bash doesn't know the syntax of csh.
csh or tcsh is what you need.

I'm most concerned about getting the list of aliases active, and I would prefer to keep the bash shell. Could you post a simple syntax where I could use "source .login" within bash? Thanks!

You can't because of the difference in syntax e.g. from you sample

alias df 'df -k'

would become for sh, ksh, bash:

alias  df='df -k'


you have to add your aliases in your .profile (.profile.bash? or .bash_profile?) or .bashrc
(can't remember now, Im in bed�)

And you source typing:

 . ./.bash_profile 

Let's just separate your personal aliases.
Just run the following commands to create an alias source file and add an inclusion in your bashrc

perl -wnle 's/(^alias \w+) (.*$)/$1=$2/ and print;' .login >> ~/.bash_aliases
cat >> ~/bashrc <<EOF
if [ -f ~/.bash_aliases ]; then
	. ~/.bash_aliases
fi
EOF

Thanks. I'm seeing the following:

.bash_profile
.bashrc
.profile
.login

All of these have alias assignments. Clearly I have some major redundancy(ies). Which of these is read upon startup? Are they read upon system boot or upon opening X11? Can I get rid of any?

Thanks again!

When Bash is invoked as an interactive login shell, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.

If you use bash you only need .bash_profile, and most time there are some lines that will check for a ~/.bashrc and use it if exists. That's why I asked you to modify it.
However, please, do not delete any of them, because they might be require if you login using another shell.

I think I am good... thanks everyone for your assistance. Sorry, are there no "Thanks" buttons anymore?