Sponsored Content
Top Forums Shell Programming and Scripting Can I modify the .bashrc file instead of .profile file to customize my login? Post 302137565 by blowtorch on Tuesday 25th of September 2007 08:37:54 PM
Old 09-25-2007
The .profile file is read only by the login shell. Any non-login shells will read the .bashrc file.
From the man page:
Code:
Login shells:
         On login (subject to the -noprofile option):
               if /etc/profile exists, source it.

               if ~/.bash_profile exists, source it,
                 else if ~/.bash_login exists, source it,
                   else if ~/.profile exists, source it.

         On exit:
               if ~/.bash_logout exists, source it.

       Non-login interactive shells:
         On startup (subject to the -norc and -rcfile options):
               if ~/.bashrc exists, source it.

In your case, the shell you're starting up isn't a login shell. So your .bashrc modification is correct.
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

.bashrc file is an initialization file run by each interactive invocation

I search the web and found the following statements ..... The /etc/profile file is a system wide initialization script which is run at login time for each user, while .profile is the users own login initialization. The .bashrc file is an initialization file run by each interactive invocation... (1 Reply)
Discussion started by: cy163
1 Replies

2. Shell Programming and Scripting

How can I customize my login script?

Hi, I am realatively new to UNIX (I started 1 week ago), and I need some help on an assignment. I am trying to find the file that will allow me to modify my login. I did some research, and most of my sources tell me to modify the ~/.cshrc and ~/.login files. The problem is that I cannot find... (1 Reply)
Discussion started by: Hyunkel
1 Replies

3. Shell Programming and Scripting

how do i look for my .bashrc file

hi i am using cygwin and would like to modify my .bashrc file. How can search to find where it is? I have looked at multiple bashrc file in /etc but none of them seemed to work..thanks (12 Replies)
Discussion started by: npatwardhan
12 Replies

4. Shell Programming and Scripting

.bashrc file

Hi experts, I am using bash shell and I cant find any .bashrc file in my home dir. Can anybody please help me out here.... If .bashrc file is not there, from where my shell config operates? Also I want to set my prompt like... $ Please advice. (5 Replies)
Discussion started by: gentleDean
5 Replies

5. UNIX for Dummies Questions & Answers

Modify .profile file

Hi there, I am really new to unix (about 3 days using it). In my assignment spec i have been told to modify my .profile file and create an environmental file. Until now all tasks have been file manipulation, etc learn how to use chmod or grep etc. I literally can't find this .profile file, I... (1 Reply)
Discussion started by: paulbuckley221
1 Replies

6. OS X (Apple)

A system deletes my .bashrc file

It deletes my .bashrc file rarely but predictability after some unknown count of Mac's restarts. Has someone ever faced such behavior? How do I prevent OS X from modifying .bashrc? What ownership/permission should I set up to not let it happen? OS X Lion. (6 Replies)
Discussion started by: scrutinizerix
6 Replies

7. Shell Programming and Scripting

Whats the profile file that is auto executed when I login

Hi, I dont find any .profile under my user home directory. These are the only files i see in my home directory. # ls -laq total 44 drwx------ 4 user1 adm 4096 Nov 23 05:10 . drwxr-xr-x. 12 root root 4096 Nov 22 13:05 .. -rw-r--r-- 1 user1 adm 18 Nov 22 13:05 .bash_logout... (3 Replies)
Discussion started by: mohtashims
3 Replies
CHSH(1) 							   User Commands							   CHSH(1)

NAME
chsh - change login shell SYNOPSIS
chsh [options] [LOGIN] DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account. OPTIONS
The options which apply to the chsh command are: -h, --help Display help message and exit. -s, --shell SHELL The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell. If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks. NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell back to its original value. FILES
/etc/passwd User account information. /etc/shells List of valid login shells. /etc/login.defs Shadow password suite configuration. SEE ALSO
chfn(1), login.defs(5), passwd(5). User Commands 06/24/2011 CHSH(1)
All times are GMT -4. The time now is 04:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy