Source .login


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Source .login
# 1  
Old 05-27-2014
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!
# 2  
Old 05-27-2014
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.
# 3  
Old 05-27-2014
Thanks.... below is the file:
____________
Code:
############   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 \
##################


Last edited by Franklin52; 05-28-2014 at 08:04 AM.. Reason: Please use code tags
# 4  
Old 05-27-2014
Quote:
Originally Posted by palex
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!
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.

Last edited by Aia; 05-27-2014 at 11:23 PM.. Reason: Added more details
# 5  
Old 05-28-2014
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!
# 6  
Old 05-28-2014
You can't because of the difference in syntax e.g. from you sample
Code:
alias df 'df -k'

would become for sh, ksh, bash:
Code:
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…)
# 7  
Old 05-28-2014
And you source typing:
Code:
 . ./.bash_profile

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

First login on KUbuntu 16.04 no SKEL copied with first login LDAPusers

Hello, we have an problem on kubuntu16.04 that when i login with ldap, and it is my first login, nothing is copied from skel. With SSH it is working fine. Can anyone say we how KDE setup an new first userlogin? Tested with SDDM and Lightdm. Thanks a lot! Best Regard darktux ----------... (1 Reply)
Discussion started by: darktux
1 Replies

2. UNIX for Advanced & Expert Users

Can adding to a new group be effective in current login environment without re-login?

Hey folks, When a user is added to a new group, the user has to be log out and log in again to make the new group effective. Is there any system command or technique to refresh user group ID update without re-login? I am not talking about to use "login" or "su -l" commands which can only make... (2 Replies)
Discussion started by: hce
2 Replies

3. Shell Programming and Scripting

passing login details to htaccess login prompt

Hi, How i can pass the login details to the URL which is password protected with the htaccess using command line or script (perl,or shell,or php). Any help or hint appreciated. Thanks, SJ (4 Replies)
Discussion started by: SilvesterJ
4 Replies

4. AIX

User Account Login Login on your AIX server

I want to learn AIX. I would like to find someone who would be willing to give me a login to their AIX home lab server. My intent is to poke around and discover the similarities and differences of AIX compared to other *NIXs. I am a UNIX admin so I can think of what some immediate concerns may... (1 Reply)
Discussion started by: perl_in_my_shel
1 Replies

5. Solaris

error message rmclomv ... SC Login Failure for user Please login:

Hello World ~ HW : SUN Fire V240 OS : Solaris 8 Error message prompts 'rmclomv ... SC login failure ...' on terminal. and Error Message prompts continually 'SC Login Failure for user Please login:' on Single Mode(init S) The System is in normal operation, though In case of rain, Can... (1 Reply)
Discussion started by: lifegeek
1 Replies

6. UNIX for Dummies Questions & Answers

how to install "source" command!/ broken "login.cl"!

Hello, I am new to this forums and this is my first "asking help" message! i have 2 problems: 1- for unknown reasons the "source" command is not avalable in my system (UBUNTU). i can't either see it in my bin directory! 2- again for unknown reasons the "login.cl" file in the home... (0 Replies)
Discussion started by: astrosona
0 Replies

7. Cybersecurity

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both, when... (1 Reply)
Discussion started by: WhotheWhat
1 Replies

8. Web Development

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both,... (2 Replies)
Discussion started by: WhotheWhat
2 Replies
Login or Register to Ask a Question