Where are my bash_profile and bash_login/logout files?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Where are my bash_profile and bash_login/logout files?
# 8  
Old 03-22-2010
tlarkin--

I'm just starting out with this, so your post is way ahead of me regharding carbon copy, writing a script, etc Smilie

I know about bash_history and bash_profile, etc. Those files aren't on my HD -- just the .profile file in my home directory. (There is bashrc, but it doesn't have anything like that, only the code for the string prompt or something like that

if [ -z "$PS1" ]; then
return
fi

PS1='\h:\W \u\$ '


there is also the profile file (in the etc dire):

if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc

I'm not sure if these files have what I'm looking for, (maybe the profile file). The .profile file only has some aliases I created -- I don't even think that was standard; I think I created it.

So, I guess what I wanted to ask is, where do you think the default profile file is. If I type set with no arguments/options, I get a list of all the environment variables that were mentioned in this section, but I just can't find the file(s) that configure them.

Any ideas?Smilie
# 9  
Old 03-22-2010
The default should be in /etc/profile

Code:
$ cat /etc/profile 
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
	eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
	[ -r /etc/bashrc ] && . /etc/bashrc
fi

Now if you look at the bash manual, you will see this

Quote:
--noprofile
Do not read either the system-wide startup file /etc/profile or any of the personal initial-
ization files ~/.bash_profile, ~/.bash_login, or ~/.profile. By default, bash reads these
files when it is invoked as a login shell (see INVOCATION below).
However, I do not think that --noprofile is enabled by default because I can still create the ~/.bash_profile and still add in custom functions, aliases, and symbolic links to my user account's .bash_profile.

It is recommended you leave the system settings, the /etc/profile alone and modify the user level one instead. That way if you botch something you can just delete your profile and get a fresh one from the system.
# 10  
Old 03-22-2010
I tried man --noprofile and got nothing, just an error message. Did I do something wrong in typing it in? There doesn't seem to be a manual entry for noprofile
# 11  
Old 03-23-2010
I think we are straying off subject here. No, those files you originally mentioned do not exist, but you can create them and Unix will abide by them if you do create them.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Renaming .bash_profile to .profile

Hi Gurus, Recently we have migrated our servers from AIX to Linux. Most of the scripts written in AIX server are sourcing environment variables using .profile file. Now we have the following options: 1. Change all the scripts where ever .profile is being used and replace it with... (14 Replies)
Discussion started by: svajhala
14 Replies

2. UNIX for Dummies Questions & Answers

.bash_profile question

Hello everyone, I'm trying to set my .bash_profile to change my primary prompt from this: banbatchtest1v:MCPPRD:~>to this: banbatchtest1v:MCPPRD:/home/rcarvall> Here's what my .bash_profile looks like right now: # .bash_profile # Get the aliases and functions if ; then .... (2 Replies)
Discussion started by: galileo1
2 Replies

3. Red Hat

.bash_profile file corrupted

Hi, Unexpectedly i entered wrong entries in .bash_profile for my user which has administrative permissions. So, i am getting errors for every command. I dont have backup file also, so any body can help me how to recover it. Regards, Mastan (7 Replies)
Discussion started by: mastansaheb
7 Replies

4. Shell Programming and Scripting

Add Variable in .bash_profile

Hi, I wanted to do the following, but the command does not seem to work. Any ideas or suggestions please help. #1. If the particular ENV variable IMPACT_HOME is not there in a file grep -q IMPACT_HOME infile || sed -i 'i IMPACT_HOME=/my/new/path' infile #2. If the ENV variable... (4 Replies)
Discussion started by: dbashyam
4 Replies

5. UNIX for Advanced & Expert Users

bash_profile or .profile

Hi, happy new year. on AIX 6.1 , for user oracle , there are two files : bash_profile and .profile I do not know which one is executed when login ? How to know , More over in both of them we have : in .profile : ORACLE_HOME=/appli/oracle/product/10.2.0/db_1... (5 Replies)
Discussion started by: big123456
5 Replies

6. Solaris

allias in .bash_profile not working

I am using solaris 10 x86. I have created a .bash_profile under root's home directory(/). The contents of the file are: Solaris10u8/# cat .bash_profile export PATH=$PATH:/usr/sfw/bin export PS1='\h\w\$ ' export PAGER="less -imsq" alias ll='ls -l' alias la='ls -a' The problem is that: ... (7 Replies)
Discussion started by: proactiveaditya
7 Replies

7. UNIX for Dummies Questions & Answers

bash_profile does not working

Hi all. when i connect as user megaguru i have a problem my .bash_profile does not working^:( if i do: . ./.bash_profile all enviroment variables are in place. How can i force linux to use .bash_profile before logon process? thanx in advance. (1 Reply)
Discussion started by: smallman
1 Replies

8. Shell Programming and Scripting

question in .bash_profile

We are more users using the oracle account, and people want to include theyr own files in .bash_profile. Like this: while ; do echo -n "LOGNAME is '$LOGNAME' (no sens), who are you? " >/dev/stderr read ln export LOGNAME=$ln done This works well when logging in to... (1 Reply)
Discussion started by: hannem
1 Replies

9. Shell Programming and Scripting

.bash_profile problem

Hi Guys, I modified my .bash_profile script , and tried to change the prompt. Following is the line of code in my .bash_profile script. export PS1=" \W " But I get the output as: \W This appears to be my prompt now. Any idea what should be done.. Thanks! (0 Replies)
Discussion started by: nua7
0 Replies

10. UNIX for Advanced & Expert Users

.bash_profile access related.

1.If a user adds the logout command in the .bash_profile file, then that user cant login.(I hope I'm correct) So, is there anyway to login into that users account without contacting the root or an administrator. 2. Is there anyway to execute a command in remote machine rsh and uux seem to fail... (6 Replies)
Discussion started by: sriram_r
6 Replies
Login or Register to Ask a Question