Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mikezang

macrumors 6502a
Original poster
May 22, 2010
939
41
Tokyo, Japan
I made a new file .bashrc to change prompt at my folder /Users/myfolder, but it doesn't work, what can I do?
 
I made a new file .bashrc to change prompt at my folder /Users/myfolder, but it doesn't work, what can I do?

Start by posting the ~/.bashrc file, and then elaborate on what exactly "it doesn't work" means.

Which text editor did you use to create and/or edit the file?
Any chance it may have non-Unix line endings? [i.e., not \n]
 
.bashxx

Don't know why, but the file I use is named .bash_profile
and it works.

HTH
 
Start by posting the ~/.bashrc file, and then elaborate on what exactly "it doesn't work" means.

Which text editor did you use to create and/or edit the file?
Any chance it may have non-Unix line endings? [i.e., not \n]
I used nano to edit my .bashrc file.

when I run ./.bashrc the "permission dinied" is showed. here is my file as below, may I have to add x permission?

-rw-r--r-- 1 mikezang staff 19 6 20:09 .bashrc
 
I used nano to edit my .bashrc file.

when I run ./.bashrc the "permission dinied" is showed. here is my file as below, may I have to add x permission?

-rw-r--r-- 1 mikezang staff 19 6 20:09 .bashrc
You misunderstand how .bashrc is supposed to work. It is supposed to be automatically invoked by the shell, and its contents executed. You shouldn't have to do anything, other than open Terminal as usual.
 
You misunderstand how .bashrc is supposed to work. It is supposed to be automatically invoked by the shell, and its contents executed. You shouldn't have to do anything, other than open Terminal as usual.
I used source .bashrc to activate it.

How can I change run attribute?
 
Yep... the startup behavior will depend on what other dot-files are present.

I use only ~/.bash_login and ~/.bashrc (and i source the second from the first). That way i have a special file for login shells, and also one for other interactive shells (such as when we execute sudo -s).

This link might work in your browser (via copy/paste):
file:///usr/share/doc/bash/bashref.html#SEC66
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.