Source .login


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Source .login
# 8  
Old 05-28-2014
Quote:
Originally Posted by palex
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!
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

Code:
perl -wnle 's/(^alias \w+) (.*$)/$1=$2/ and print;' .login >> ~/.bash_aliases

Code:
cat >> ~/bashrc <<EOF
if [ -f ~/.bash_aliases ]; then
	. ~/.bash_aliases
fi
EOF

# 9  
Old 05-28-2014
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!
# 10  
Old 05-28-2014
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.
# 11  
Old 05-28-2014
Quote:
Originally Posted by palex
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!
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.
# 12  
Old 05-28-2014
I think I am good... thanks everyone for your assistance. Sorry, are there no "Thanks" buttons anymore?
# 13  
Old 05-29-2014
Quote:
Originally Posted by palex
I think I am good... thanks everyone for your assistance. Sorry, are there no "Thanks" buttons anymore?
Moderator's Comments:
Mod Comment The "Thanks" button is still there in the lower right corner of each post along with the "Edit" and "Quote" buttons. But, they aren't visible while you're editing a message.
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