[solved] Where & what bash env file, Mac OS?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers [solved] Where & what bash env file, Mac OS?
# 1  
Old 11-10-2012
[solved] Where & what bash env file, Mac OS?

Hi!
I wanted to simplify my bash prompt, so I edited my etc/bashrc file. I thought this was the file that would override any other env files. When I opened it, I saw that the way it was setup was not what my prompt looked like, although I forget exactly what was there. But i edited it the way I wanted it
Code:
PS1="$ "

and saved it. I quit and restarted the Terminal, but my prompt hadn't changed. I looked at the environment and saw that the prompt was set entirely differently than what was originally in the /etc/bashrc file, or what I changed it to:
Code:
-bash $ env |grep PS
PS1=\s $

So I assumed it must be getting it's environmental variables from some other file. But I don't have any kind of bash files in my home dir, such as .bash_profile, (except .bash_history).
At this point I should mention that I'm using Mac OS 10.6, and the directory setup is a little different in some cases than standard unix.

My question is, where is bash ultimately getting its env variables from, and where might I find this file?

Also, is there a way to write directly to the bash environment from the terminal, such as when you add a directory to your PATH? If so, how should that look?
TIA!

---------- Post updated at 03:33 PM ---------- Previous update was at 03:26 PM ----------

Nevermind, it's the ~/.profile file.

Last edited by sudon't; 11-10-2012 at 04:27 PM.. Reason: forgot a dot
# 2  
Old 11-13-2012
First, type env at the prompt to find out what your environment variables are. Put the command string for how you want your prompt to appear in your .bash_profile file, be sure to export the variable and either log out and log in again, or run source .bash_profile.

HTH
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sourcing Env file with eval works with ksh but not BASH

Hi, I am running this on Redhat 5.10 I have a simple test script called test.sh which has the following contents and it uses the BASH shebang. ------------------------------------------------------------- #!/bin/bash eval `/tmp/filereader.pl /tmp/envfile.txt` echo "TESTPATH=$TESTPATH" ... (28 Replies)
Discussion started by: waavman
28 Replies

2. Shell Programming and Scripting

[Solved] Isolating & Counting IP from log file

Dear Community, today my website was under attack for several hours. 2 specific IPs make a tons of "get requests" to a specific page and apache server goes up and down. Now the problem is solved because I put in firewall blacklist these IPs, but I took a lot of time to analyze the apache log to... (6 Replies)
Discussion started by: Lord Spectre
6 Replies

3. UNIX for Dummies Questions & Answers

[Solved] Problem bash if file exists then < do...> else <do...>

Hi ! I have a problem with an if/else statement in bash. I want to check if the file exists before running a task (for example here, counting lines), and if not I need to create an empty output file if then wc -l input.tab > output.temp else >output.temp fi The problem is even if the... (2 Replies)
Discussion started by: beca123456
2 Replies

4. Shell Programming and Scripting

[Solved] BASH - chaining TEST and COMMAND with && and II

Can you explain what this line of script is doing. What I have understood is : -- variable C is the name of a software which is either not installed, so it must be installed or allready installed and then should be update if newer version found -- branch B="$B $C" is to install the software --... (4 Replies)
Discussion started by: jcdole
4 Replies

5. UNIX for Dummies Questions & Answers

Unzip & Env Path Name

I need to download team foundation server on Unix (4 simple instructions below), but I am stuck.. I am newbie Unix user, so please be patient. -cd /home/Myname/Downloads, Unzip -Unzipped to /home/Myname/DestFolder -cd DestFolder, type tf -help, works there - outside this folder, doesn't... (1 Reply)
Discussion started by: software2007
1 Replies

6. Shell Programming and Scripting

[solved] how to get specific env variable values into a file

greetings! how do i get an env variable that looks like this when echoed: into a file that looks like this: keeping in mind that the two constants are the fields from the env variable will always be in odd positions of the string that need to go into the file AND they will always start... (3 Replies)
Discussion started by: crimso
3 Replies

7. Shell Programming and Scripting

Importing env from csh to bash

Hi All, In my account with csh shell, there are lots of env variables set and I want to import those all to bash in one stroke, is there any way to do it ? Thanks, D (1 Reply)
Discussion started by: Deei
1 Replies

8. Shell Programming and Scripting

bash: checking file size -solved

Hello I have srv RHEL5, file system UTDM (EMC DiskXtender Unix/Linux File System Manager 3.5 & EMC Centera). it all works under the scheme: have disk is formatted with a file system UTDM, drive open network - NFS, it write data, then migrate the data in the repository - EMC Centera. There are... (0 Replies)
Discussion started by: moskovets
0 Replies

9. OS X (Apple)

which file is sourced by bash on login (Mac OS X 10.5.3)?

Hi: So my current Python (2.52) rig is not working as intended. "echo $PATH" in bash gives me 'X'" that's not what i want, so i need to change my path. To do that, there appeared to be four choices (all in my ~/ directory--note: I'm root, it's my Mac, but i'm in a user account): .profile... (2 Replies)
Discussion started by: Alex_Land
2 Replies

10. Shell Programming and Scripting

bash env variable containing @

I want to set a bash env variable which has @ in its name, for example, @YOGESH@ may i know how do i do this? (4 Replies)
Discussion started by: Yogesh Sawant
4 Replies
Login or Register to Ask a Question