.bashrc not sourced in iTerm + Mac OS X
I am using iTerm in Mac OS X 10.6. It seems when I open iTerm, neither .bashrc
nor .bash_profile
is sourced. I can tell because the aliases defined in .bashrc
are not set. How to fix?
mac bash
migrated from stackoverflow.com Aug 7 '11 at 9:57
This question came from our site for professional and enthusiast programmers.
add a comment |
I am using iTerm in Mac OS X 10.6. It seems when I open iTerm, neither .bashrc
nor .bash_profile
is sourced. I can tell because the aliases defined in .bashrc
are not set. How to fix?
mac bash
migrated from stackoverflow.com Aug 7 '11 at 9:57
This question came from our site for professional and enthusiast programmers.
2
What's happening is~/.bash_profile
is being invoked by bash first, which is short circuiting the instructions you have in~/.bashrc
. This problem can happen unexpectedly if a rogue program adds some instructions to your~/.bash_profile
when previously the file didn't exist, and you had placed all your bash commands in~/.bashrc
. The solution is to either delete your ~/.bash_profile, or to have ~/.bash_profile source your ~/.bashrc. This can be performed by adding the command:source ~/.bashrc
to the end of your~/.bash_profile
and restarting the terminal.
– Eric Leschinski
Aug 27 '17 at 15:16
add a comment |
I am using iTerm in Mac OS X 10.6. It seems when I open iTerm, neither .bashrc
nor .bash_profile
is sourced. I can tell because the aliases defined in .bashrc
are not set. How to fix?
mac bash
I am using iTerm in Mac OS X 10.6. It seems when I open iTerm, neither .bashrc
nor .bash_profile
is sourced. I can tell because the aliases defined in .bashrc
are not set. How to fix?
mac bash
mac bash
edited Aug 27 '17 at 15:12
Eric Leschinski
4,25843646
4,25843646
asked Aug 7 '11 at 2:01
ComputistComputist
1,20642030
1,20642030
migrated from stackoverflow.com Aug 7 '11 at 9:57
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Aug 7 '11 at 9:57
This question came from our site for professional and enthusiast programmers.
2
What's happening is~/.bash_profile
is being invoked by bash first, which is short circuiting the instructions you have in~/.bashrc
. This problem can happen unexpectedly if a rogue program adds some instructions to your~/.bash_profile
when previously the file didn't exist, and you had placed all your bash commands in~/.bashrc
. The solution is to either delete your ~/.bash_profile, or to have ~/.bash_profile source your ~/.bashrc. This can be performed by adding the command:source ~/.bashrc
to the end of your~/.bash_profile
and restarting the terminal.
– Eric Leschinski
Aug 27 '17 at 15:16
add a comment |
2
What's happening is~/.bash_profile
is being invoked by bash first, which is short circuiting the instructions you have in~/.bashrc
. This problem can happen unexpectedly if a rogue program adds some instructions to your~/.bash_profile
when previously the file didn't exist, and you had placed all your bash commands in~/.bashrc
. The solution is to either delete your ~/.bash_profile, or to have ~/.bash_profile source your ~/.bashrc. This can be performed by adding the command:source ~/.bashrc
to the end of your~/.bash_profile
and restarting the terminal.
– Eric Leschinski
Aug 27 '17 at 15:16
2
2
What's happening is
~/.bash_profile
is being invoked by bash first, which is short circuiting the instructions you have in ~/.bashrc
. This problem can happen unexpectedly if a rogue program adds some instructions to your ~/.bash_profile
when previously the file didn't exist, and you had placed all your bash commands in ~/.bashrc
. The solution is to either delete your ~/.bash_profile, or to have ~/.bash_profile source your ~/.bashrc. This can be performed by adding the command: source ~/.bashrc
to the end of your ~/.bash_profile
and restarting the terminal.– Eric Leschinski
Aug 27 '17 at 15:16
What's happening is
~/.bash_profile
is being invoked by bash first, which is short circuiting the instructions you have in ~/.bashrc
. This problem can happen unexpectedly if a rogue program adds some instructions to your ~/.bash_profile
when previously the file didn't exist, and you had placed all your bash commands in ~/.bashrc
. The solution is to either delete your ~/.bash_profile, or to have ~/.bash_profile source your ~/.bashrc. This can be performed by adding the command: source ~/.bashrc
to the end of your ~/.bash_profile
and restarting the terminal.– Eric Leschinski
Aug 27 '17 at 15:16
add a comment |
12 Answers
12
active
oldest
votes
Bash will source EITHER .bash_profile or .bashrc, depending upon how it is called. If it is a login shell, Bash looks for ~/.bash_profile, ~/.bash_login, or ~/.profile, in that order, and sources the first one it finds (and only that one). If it is not a login shell but is interactive (like most terminal sessions), Bash will source ~/.bashrc.
Likely, iTerm is looking for ~/.bashrc. If it's configured to start as a login shell, it will look for ~/.bash_profile. It's almost certainly an error within the config file rather than that the shell is not sourcing it.
I would put a line at the beginning of each file. At the top of ~/.bash_profile:
export BASH_CONF="bash_profile"
And at the top of ~/.bashrc:
export BASH_CONF="bashrc"
Then, open a new iTerm and type
$ echo $BASH_CONF
That should confirm the file is being sourced and you can look into the syntax of the file.
1
Setting a different environment variable for each source file allows for more information, that is, if more than one file is sourced, you'll know it, nost just the last one (if not the order sourced.)
– kmarsh
Nov 23 '15 at 18:47
This still doesn't load the .bashrc file. I had to add source ~/.bashrc to my iTerm and Terminal Preferences. btw I'm using Mac OS X 10.9.5.
– Giant Elk
May 26 '16 at 1:06
I just added a .profile file and that automatically works on OS X 10.9.5 without messing in your terminal preferences.
– Giant Elk
May 26 '16 at 1:11
1
I found out it is a login shell by going to preferences -> profiles -> general and login shell is selected under command. Valid on MacOS El Capitan and iTerm2 3.0.14
– Aditya
Mar 2 '17 at 17:37
The solution here did not work for me, but I found a solution. In the beginning, there was no bashrc and no bash_profile. The answer here proposes to create a bashrc. Instead of creating a bashrc file I created a bash_profile, and it worked. Now I need to understand why the bashrc was not executed and the bash_profile yes.
– kalmanIsAGameChanger
Aug 17 '18 at 15:17
|
show 1 more comment
In iTerm2, none of these solutions worked for me. I was able to get it to properly read my .bashrc file by adding the command
source ~/.bashrc
to the Send text at start: field in Settings/General for my iTerm profile.
What happened when you did what the accepted answer suggests? No output?
– Daniel Beck♦
Jun 13 '12 at 18:15
Right. I got no output, and iTerm 2 just loaded the default bash shell with none of my aliases.
– Mark Struzinski
Jun 13 '12 at 18:25
That answer was broken until just now -- the second snippet was supposed to go into~/.bashrc
. Edited it.
– Daniel Beck♦
Jun 16 '12 at 6:13
I use ZSH and was having the same issue. Except that none of my config file existed in the first place and had to be created. I used this answer and set the "Send text at start" however, when i restarted ZSH created it's .zsh and overwrote my file, i was able to remove the "Send text at start" and add my configs to the newly generated file. Not sure if this helps anyone
– Arnolio
Dec 8 '16 at 16:23
I thought this was my problem.. and then along the way realized that my home catalogue was not the folder I started out in.. so as I moved my .bash_profile to another location and I thought I was ln -s (symlinking to it from my ~ (home) catalogue, I was in fact adding a symlink in the wrong folder. Adding this here in case it helps someone else, who was going for this answer.
– Alisso
Apr 17 '17 at 12:45
|
show 1 more comment
I just wonder do you really use Bash? May be you can use echo $SHELL
, it is quite possible that you are using zsh, have you installed on-my-zh?
Acutually I encounter the same problem as you, I fix it by configuring ~/.zshrc instead either ~/.bash_profile for login shell or ~/.bashrc for non-login shell.
Maybe you can have a try
1
Interesting suggestion, although this question is 3 years old and has an accepted answer.
– Tyson
Dec 2 '14 at 13:55
add a comment |
On my 10.6 machine ~/.profile
is sourced. So a source .bashrc
entry in ~/.profile
should do the job.
Worked for me on Mac OS El Capitan.
– user674669
Jun 15 '16 at 20:56
My experience says you do not want to source one .bashx file from another, they are separate for a reason :) If you are doing that, then something is wrong
– Alexander Mills
Feb 20 '17 at 21:55
@AlexanderMills The reason these files exist is because Mac ripped them straight outta Unix. There's no reason they all shouldn't be loaded for a user.
– RaisinBranCrunch
Feb 7 at 21:35
you can get circular calls if they load each other, is the problem, best way to avoid that is to flip a boolean with an env var and only load the other files if the boolean is not set.
– Alexander Mills
Feb 7 at 22:03
add a comment |
Easy fix.
1. Open your ~/.zshrc
file
2. Add the following line at the end of the file.
source ~/.bash_profile
1
Brilliant! That did it for me. It never occurred to me that zsh was getting in the way after I installed Oh-my-zh.
– Cindy Conway
Apr 19 '18 at 14:34
add a comment |
On my 10.9 machine ~/.bash_profile is sourced. So a source .bashrc entry in ~/.bash_profile should do the job.
add a comment |
Put your alias definitions in the bash profile file, you have to create the file but it will be sourced automatically. I create a separate file called alias.configuration and source it in .bash_profile just because I have another user defined and want to have the same alias set.
1
Actually neither.bashrc
nor.bash_profile
are sourced.
– Computist
Aug 7 '11 at 6:02
add a comment |
On 10.10 and iTerm2 2.0, customized profile
- .bash_rc should work.
- .bash_profile, try "/bin/bash --login" instead of "/bin/bash"
I voted up this answer because it seems to be the only one acknowledging that in OS X,at some point, bash would source ".bash_rc" instead of ".bashrc" . I only came here because I was trying to find out why (and I still don't know).
– Marnix A. van Ammers
Feb 2 '16 at 18:09
add a comment |
In iTerm2, ensure you're using "login shell" instead of a custom command including "login", which doesn't do what you expect.
What does iTerm2 command actually do?
– studgeek
Apr 9 '16 at 21:24
add a comment |
Add
set -x
to the beginning of /etc/profile
. This gives you a line-by-line account of everything that gets executed when bash
starts up, including files sourced from within /etc/profile
, ~/.bash_profile
, etc. It's a bit daunting if you don't understand bash
scripting very well, but you may be able to see if there is an error in a start-up file, and the output will be useful for someone proficient in bash
to help you locate your problem.
You can remove the set -x
line when you're finished troubleshooting.
add a comment |
Make the following change and iTerm will source bashrc
iTerm > Preferences > General > [x] Command: /bin/bash
add a comment |
I combined couple solutions together to work it like expected.
.bash_profile
source and run on zsh.
Preferences -> Profiles -> General
.
Select Command under Command .
And add in the text box /bin/bash --login
.
Then in .bash_profile add line
/bin/zsh --login
That's it.
(1) What? (2) If you are havingbash
always runzsh
, that is not what anybody expects.
– Scott
Mar 5 '18 at 5:56
If I set /bin/bash --login, it doesn't provide any features of zsh. Then If I change it to loginshell in preference, it doesn't read .bash_profile. Everytime I have to runsource ~/.bash_profile
manually. @Scott After doing the above things, I have zsh in the required way.
– muhammed basil
Mar 5 '18 at 8:07
(1) My point is thatzsh
might be what you desire, but it is not required or asked for by this question, which is tagged [bash] and doesn’t say anything aboutzsh
. (2) If you define aliases and shell functions and set variables (without exporting them) in your.bashrc
and/or.bash_profile
, are they available to you in yourzsh
shell?
– Scott
Mar 5 '18 at 15:32
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f320065%2fbashrc-not-sourced-in-iterm-mac-os-x%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
12 Answers
12
active
oldest
votes
12 Answers
12
active
oldest
votes
active
oldest
votes
active
oldest
votes
Bash will source EITHER .bash_profile or .bashrc, depending upon how it is called. If it is a login shell, Bash looks for ~/.bash_profile, ~/.bash_login, or ~/.profile, in that order, and sources the first one it finds (and only that one). If it is not a login shell but is interactive (like most terminal sessions), Bash will source ~/.bashrc.
Likely, iTerm is looking for ~/.bashrc. If it's configured to start as a login shell, it will look for ~/.bash_profile. It's almost certainly an error within the config file rather than that the shell is not sourcing it.
I would put a line at the beginning of each file. At the top of ~/.bash_profile:
export BASH_CONF="bash_profile"
And at the top of ~/.bashrc:
export BASH_CONF="bashrc"
Then, open a new iTerm and type
$ echo $BASH_CONF
That should confirm the file is being sourced and you can look into the syntax of the file.
1
Setting a different environment variable for each source file allows for more information, that is, if more than one file is sourced, you'll know it, nost just the last one (if not the order sourced.)
– kmarsh
Nov 23 '15 at 18:47
This still doesn't load the .bashrc file. I had to add source ~/.bashrc to my iTerm and Terminal Preferences. btw I'm using Mac OS X 10.9.5.
– Giant Elk
May 26 '16 at 1:06
I just added a .profile file and that automatically works on OS X 10.9.5 without messing in your terminal preferences.
– Giant Elk
May 26 '16 at 1:11
1
I found out it is a login shell by going to preferences -> profiles -> general and login shell is selected under command. Valid on MacOS El Capitan and iTerm2 3.0.14
– Aditya
Mar 2 '17 at 17:37
The solution here did not work for me, but I found a solution. In the beginning, there was no bashrc and no bash_profile. The answer here proposes to create a bashrc. Instead of creating a bashrc file I created a bash_profile, and it worked. Now I need to understand why the bashrc was not executed and the bash_profile yes.
– kalmanIsAGameChanger
Aug 17 '18 at 15:17
|
show 1 more comment
Bash will source EITHER .bash_profile or .bashrc, depending upon how it is called. If it is a login shell, Bash looks for ~/.bash_profile, ~/.bash_login, or ~/.profile, in that order, and sources the first one it finds (and only that one). If it is not a login shell but is interactive (like most terminal sessions), Bash will source ~/.bashrc.
Likely, iTerm is looking for ~/.bashrc. If it's configured to start as a login shell, it will look for ~/.bash_profile. It's almost certainly an error within the config file rather than that the shell is not sourcing it.
I would put a line at the beginning of each file. At the top of ~/.bash_profile:
export BASH_CONF="bash_profile"
And at the top of ~/.bashrc:
export BASH_CONF="bashrc"
Then, open a new iTerm and type
$ echo $BASH_CONF
That should confirm the file is being sourced and you can look into the syntax of the file.
1
Setting a different environment variable for each source file allows for more information, that is, if more than one file is sourced, you'll know it, nost just the last one (if not the order sourced.)
– kmarsh
Nov 23 '15 at 18:47
This still doesn't load the .bashrc file. I had to add source ~/.bashrc to my iTerm and Terminal Preferences. btw I'm using Mac OS X 10.9.5.
– Giant Elk
May 26 '16 at 1:06
I just added a .profile file and that automatically works on OS X 10.9.5 without messing in your terminal preferences.
– Giant Elk
May 26 '16 at 1:11
1
I found out it is a login shell by going to preferences -> profiles -> general and login shell is selected under command. Valid on MacOS El Capitan and iTerm2 3.0.14
– Aditya
Mar 2 '17 at 17:37
The solution here did not work for me, but I found a solution. In the beginning, there was no bashrc and no bash_profile. The answer here proposes to create a bashrc. Instead of creating a bashrc file I created a bash_profile, and it worked. Now I need to understand why the bashrc was not executed and the bash_profile yes.
– kalmanIsAGameChanger
Aug 17 '18 at 15:17
|
show 1 more comment
Bash will source EITHER .bash_profile or .bashrc, depending upon how it is called. If it is a login shell, Bash looks for ~/.bash_profile, ~/.bash_login, or ~/.profile, in that order, and sources the first one it finds (and only that one). If it is not a login shell but is interactive (like most terminal sessions), Bash will source ~/.bashrc.
Likely, iTerm is looking for ~/.bashrc. If it's configured to start as a login shell, it will look for ~/.bash_profile. It's almost certainly an error within the config file rather than that the shell is not sourcing it.
I would put a line at the beginning of each file. At the top of ~/.bash_profile:
export BASH_CONF="bash_profile"
And at the top of ~/.bashrc:
export BASH_CONF="bashrc"
Then, open a new iTerm and type
$ echo $BASH_CONF
That should confirm the file is being sourced and you can look into the syntax of the file.
Bash will source EITHER .bash_profile or .bashrc, depending upon how it is called. If it is a login shell, Bash looks for ~/.bash_profile, ~/.bash_login, or ~/.profile, in that order, and sources the first one it finds (and only that one). If it is not a login shell but is interactive (like most terminal sessions), Bash will source ~/.bashrc.
Likely, iTerm is looking for ~/.bashrc. If it's configured to start as a login shell, it will look for ~/.bash_profile. It's almost certainly an error within the config file rather than that the shell is not sourcing it.
I would put a line at the beginning of each file. At the top of ~/.bash_profile:
export BASH_CONF="bash_profile"
And at the top of ~/.bashrc:
export BASH_CONF="bashrc"
Then, open a new iTerm and type
$ echo $BASH_CONF
That should confirm the file is being sourced and you can look into the syntax of the file.
edited Jun 16 '12 at 6:12
Daniel Beck♦
93.2k12236288
93.2k12236288
answered Aug 7 '11 at 6:33
brightlancerbrightlancer
84673
84673
1
Setting a different environment variable for each source file allows for more information, that is, if more than one file is sourced, you'll know it, nost just the last one (if not the order sourced.)
– kmarsh
Nov 23 '15 at 18:47
This still doesn't load the .bashrc file. I had to add source ~/.bashrc to my iTerm and Terminal Preferences. btw I'm using Mac OS X 10.9.5.
– Giant Elk
May 26 '16 at 1:06
I just added a .profile file and that automatically works on OS X 10.9.5 without messing in your terminal preferences.
– Giant Elk
May 26 '16 at 1:11
1
I found out it is a login shell by going to preferences -> profiles -> general and login shell is selected under command. Valid on MacOS El Capitan and iTerm2 3.0.14
– Aditya
Mar 2 '17 at 17:37
The solution here did not work for me, but I found a solution. In the beginning, there was no bashrc and no bash_profile. The answer here proposes to create a bashrc. Instead of creating a bashrc file I created a bash_profile, and it worked. Now I need to understand why the bashrc was not executed and the bash_profile yes.
– kalmanIsAGameChanger
Aug 17 '18 at 15:17
|
show 1 more comment
1
Setting a different environment variable for each source file allows for more information, that is, if more than one file is sourced, you'll know it, nost just the last one (if not the order sourced.)
– kmarsh
Nov 23 '15 at 18:47
This still doesn't load the .bashrc file. I had to add source ~/.bashrc to my iTerm and Terminal Preferences. btw I'm using Mac OS X 10.9.5.
– Giant Elk
May 26 '16 at 1:06
I just added a .profile file and that automatically works on OS X 10.9.5 without messing in your terminal preferences.
– Giant Elk
May 26 '16 at 1:11
1
I found out it is a login shell by going to preferences -> profiles -> general and login shell is selected under command. Valid on MacOS El Capitan and iTerm2 3.0.14
– Aditya
Mar 2 '17 at 17:37
The solution here did not work for me, but I found a solution. In the beginning, there was no bashrc and no bash_profile. The answer here proposes to create a bashrc. Instead of creating a bashrc file I created a bash_profile, and it worked. Now I need to understand why the bashrc was not executed and the bash_profile yes.
– kalmanIsAGameChanger
Aug 17 '18 at 15:17
1
1
Setting a different environment variable for each source file allows for more information, that is, if more than one file is sourced, you'll know it, nost just the last one (if not the order sourced.)
– kmarsh
Nov 23 '15 at 18:47
Setting a different environment variable for each source file allows for more information, that is, if more than one file is sourced, you'll know it, nost just the last one (if not the order sourced.)
– kmarsh
Nov 23 '15 at 18:47
This still doesn't load the .bashrc file. I had to add source ~/.bashrc to my iTerm and Terminal Preferences. btw I'm using Mac OS X 10.9.5.
– Giant Elk
May 26 '16 at 1:06
This still doesn't load the .bashrc file. I had to add source ~/.bashrc to my iTerm and Terminal Preferences. btw I'm using Mac OS X 10.9.5.
– Giant Elk
May 26 '16 at 1:06
I just added a .profile file and that automatically works on OS X 10.9.5 without messing in your terminal preferences.
– Giant Elk
May 26 '16 at 1:11
I just added a .profile file and that automatically works on OS X 10.9.5 without messing in your terminal preferences.
– Giant Elk
May 26 '16 at 1:11
1
1
I found out it is a login shell by going to preferences -> profiles -> general and login shell is selected under command. Valid on MacOS El Capitan and iTerm2 3.0.14
– Aditya
Mar 2 '17 at 17:37
I found out it is a login shell by going to preferences -> profiles -> general and login shell is selected under command. Valid on MacOS El Capitan and iTerm2 3.0.14
– Aditya
Mar 2 '17 at 17:37
The solution here did not work for me, but I found a solution. In the beginning, there was no bashrc and no bash_profile. The answer here proposes to create a bashrc. Instead of creating a bashrc file I created a bash_profile, and it worked. Now I need to understand why the bashrc was not executed and the bash_profile yes.
– kalmanIsAGameChanger
Aug 17 '18 at 15:17
The solution here did not work for me, but I found a solution. In the beginning, there was no bashrc and no bash_profile. The answer here proposes to create a bashrc. Instead of creating a bashrc file I created a bash_profile, and it worked. Now I need to understand why the bashrc was not executed and the bash_profile yes.
– kalmanIsAGameChanger
Aug 17 '18 at 15:17
|
show 1 more comment
In iTerm2, none of these solutions worked for me. I was able to get it to properly read my .bashrc file by adding the command
source ~/.bashrc
to the Send text at start: field in Settings/General for my iTerm profile.
What happened when you did what the accepted answer suggests? No output?
– Daniel Beck♦
Jun 13 '12 at 18:15
Right. I got no output, and iTerm 2 just loaded the default bash shell with none of my aliases.
– Mark Struzinski
Jun 13 '12 at 18:25
That answer was broken until just now -- the second snippet was supposed to go into~/.bashrc
. Edited it.
– Daniel Beck♦
Jun 16 '12 at 6:13
I use ZSH and was having the same issue. Except that none of my config file existed in the first place and had to be created. I used this answer and set the "Send text at start" however, when i restarted ZSH created it's .zsh and overwrote my file, i was able to remove the "Send text at start" and add my configs to the newly generated file. Not sure if this helps anyone
– Arnolio
Dec 8 '16 at 16:23
I thought this was my problem.. and then along the way realized that my home catalogue was not the folder I started out in.. so as I moved my .bash_profile to another location and I thought I was ln -s (symlinking to it from my ~ (home) catalogue, I was in fact adding a symlink in the wrong folder. Adding this here in case it helps someone else, who was going for this answer.
– Alisso
Apr 17 '17 at 12:45
|
show 1 more comment
In iTerm2, none of these solutions worked for me. I was able to get it to properly read my .bashrc file by adding the command
source ~/.bashrc
to the Send text at start: field in Settings/General for my iTerm profile.
What happened when you did what the accepted answer suggests? No output?
– Daniel Beck♦
Jun 13 '12 at 18:15
Right. I got no output, and iTerm 2 just loaded the default bash shell with none of my aliases.
– Mark Struzinski
Jun 13 '12 at 18:25
That answer was broken until just now -- the second snippet was supposed to go into~/.bashrc
. Edited it.
– Daniel Beck♦
Jun 16 '12 at 6:13
I use ZSH and was having the same issue. Except that none of my config file existed in the first place and had to be created. I used this answer and set the "Send text at start" however, when i restarted ZSH created it's .zsh and overwrote my file, i was able to remove the "Send text at start" and add my configs to the newly generated file. Not sure if this helps anyone
– Arnolio
Dec 8 '16 at 16:23
I thought this was my problem.. and then along the way realized that my home catalogue was not the folder I started out in.. so as I moved my .bash_profile to another location and I thought I was ln -s (symlinking to it from my ~ (home) catalogue, I was in fact adding a symlink in the wrong folder. Adding this here in case it helps someone else, who was going for this answer.
– Alisso
Apr 17 '17 at 12:45
|
show 1 more comment
In iTerm2, none of these solutions worked for me. I was able to get it to properly read my .bashrc file by adding the command
source ~/.bashrc
to the Send text at start: field in Settings/General for my iTerm profile.
In iTerm2, none of these solutions worked for me. I was able to get it to properly read my .bashrc file by adding the command
source ~/.bashrc
to the Send text at start: field in Settings/General for my iTerm profile.
answered Jun 13 '12 at 17:35
Mark StruzinskiMark Struzinski
8351810
8351810
What happened when you did what the accepted answer suggests? No output?
– Daniel Beck♦
Jun 13 '12 at 18:15
Right. I got no output, and iTerm 2 just loaded the default bash shell with none of my aliases.
– Mark Struzinski
Jun 13 '12 at 18:25
That answer was broken until just now -- the second snippet was supposed to go into~/.bashrc
. Edited it.
– Daniel Beck♦
Jun 16 '12 at 6:13
I use ZSH and was having the same issue. Except that none of my config file existed in the first place and had to be created. I used this answer and set the "Send text at start" however, when i restarted ZSH created it's .zsh and overwrote my file, i was able to remove the "Send text at start" and add my configs to the newly generated file. Not sure if this helps anyone
– Arnolio
Dec 8 '16 at 16:23
I thought this was my problem.. and then along the way realized that my home catalogue was not the folder I started out in.. so as I moved my .bash_profile to another location and I thought I was ln -s (symlinking to it from my ~ (home) catalogue, I was in fact adding a symlink in the wrong folder. Adding this here in case it helps someone else, who was going for this answer.
– Alisso
Apr 17 '17 at 12:45
|
show 1 more comment
What happened when you did what the accepted answer suggests? No output?
– Daniel Beck♦
Jun 13 '12 at 18:15
Right. I got no output, and iTerm 2 just loaded the default bash shell with none of my aliases.
– Mark Struzinski
Jun 13 '12 at 18:25
That answer was broken until just now -- the second snippet was supposed to go into~/.bashrc
. Edited it.
– Daniel Beck♦
Jun 16 '12 at 6:13
I use ZSH and was having the same issue. Except that none of my config file existed in the first place and had to be created. I used this answer and set the "Send text at start" however, when i restarted ZSH created it's .zsh and overwrote my file, i was able to remove the "Send text at start" and add my configs to the newly generated file. Not sure if this helps anyone
– Arnolio
Dec 8 '16 at 16:23
I thought this was my problem.. and then along the way realized that my home catalogue was not the folder I started out in.. so as I moved my .bash_profile to another location and I thought I was ln -s (symlinking to it from my ~ (home) catalogue, I was in fact adding a symlink in the wrong folder. Adding this here in case it helps someone else, who was going for this answer.
– Alisso
Apr 17 '17 at 12:45
What happened when you did what the accepted answer suggests? No output?
– Daniel Beck♦
Jun 13 '12 at 18:15
What happened when you did what the accepted answer suggests? No output?
– Daniel Beck♦
Jun 13 '12 at 18:15
Right. I got no output, and iTerm 2 just loaded the default bash shell with none of my aliases.
– Mark Struzinski
Jun 13 '12 at 18:25
Right. I got no output, and iTerm 2 just loaded the default bash shell with none of my aliases.
– Mark Struzinski
Jun 13 '12 at 18:25
That answer was broken until just now -- the second snippet was supposed to go into
~/.bashrc
. Edited it.– Daniel Beck♦
Jun 16 '12 at 6:13
That answer was broken until just now -- the second snippet was supposed to go into
~/.bashrc
. Edited it.– Daniel Beck♦
Jun 16 '12 at 6:13
I use ZSH and was having the same issue. Except that none of my config file existed in the first place and had to be created. I used this answer and set the "Send text at start" however, when i restarted ZSH created it's .zsh and overwrote my file, i was able to remove the "Send text at start" and add my configs to the newly generated file. Not sure if this helps anyone
– Arnolio
Dec 8 '16 at 16:23
I use ZSH and was having the same issue. Except that none of my config file existed in the first place and had to be created. I used this answer and set the "Send text at start" however, when i restarted ZSH created it's .zsh and overwrote my file, i was able to remove the "Send text at start" and add my configs to the newly generated file. Not sure if this helps anyone
– Arnolio
Dec 8 '16 at 16:23
I thought this was my problem.. and then along the way realized that my home catalogue was not the folder I started out in.. so as I moved my .bash_profile to another location and I thought I was ln -s (symlinking to it from my ~ (home) catalogue, I was in fact adding a symlink in the wrong folder. Adding this here in case it helps someone else, who was going for this answer.
– Alisso
Apr 17 '17 at 12:45
I thought this was my problem.. and then along the way realized that my home catalogue was not the folder I started out in.. so as I moved my .bash_profile to another location and I thought I was ln -s (symlinking to it from my ~ (home) catalogue, I was in fact adding a symlink in the wrong folder. Adding this here in case it helps someone else, who was going for this answer.
– Alisso
Apr 17 '17 at 12:45
|
show 1 more comment
I just wonder do you really use Bash? May be you can use echo $SHELL
, it is quite possible that you are using zsh, have you installed on-my-zh?
Acutually I encounter the same problem as you, I fix it by configuring ~/.zshrc instead either ~/.bash_profile for login shell or ~/.bashrc for non-login shell.
Maybe you can have a try
1
Interesting suggestion, although this question is 3 years old and has an accepted answer.
– Tyson
Dec 2 '14 at 13:55
add a comment |
I just wonder do you really use Bash? May be you can use echo $SHELL
, it is quite possible that you are using zsh, have you installed on-my-zh?
Acutually I encounter the same problem as you, I fix it by configuring ~/.zshrc instead either ~/.bash_profile for login shell or ~/.bashrc for non-login shell.
Maybe you can have a try
1
Interesting suggestion, although this question is 3 years old and has an accepted answer.
– Tyson
Dec 2 '14 at 13:55
add a comment |
I just wonder do you really use Bash? May be you can use echo $SHELL
, it is quite possible that you are using zsh, have you installed on-my-zh?
Acutually I encounter the same problem as you, I fix it by configuring ~/.zshrc instead either ~/.bash_profile for login shell or ~/.bashrc for non-login shell.
Maybe you can have a try
I just wonder do you really use Bash? May be you can use echo $SHELL
, it is quite possible that you are using zsh, have you installed on-my-zh?
Acutually I encounter the same problem as you, I fix it by configuring ~/.zshrc instead either ~/.bash_profile for login shell or ~/.bashrc for non-login shell.
Maybe you can have a try
answered Dec 2 '14 at 13:25
AaronChenAaronChen
30122
30122
1
Interesting suggestion, although this question is 3 years old and has an accepted answer.
– Tyson
Dec 2 '14 at 13:55
add a comment |
1
Interesting suggestion, although this question is 3 years old and has an accepted answer.
– Tyson
Dec 2 '14 at 13:55
1
1
Interesting suggestion, although this question is 3 years old and has an accepted answer.
– Tyson
Dec 2 '14 at 13:55
Interesting suggestion, although this question is 3 years old and has an accepted answer.
– Tyson
Dec 2 '14 at 13:55
add a comment |
On my 10.6 machine ~/.profile
is sourced. So a source .bashrc
entry in ~/.profile
should do the job.
Worked for me on Mac OS El Capitan.
– user674669
Jun 15 '16 at 20:56
My experience says you do not want to source one .bashx file from another, they are separate for a reason :) If you are doing that, then something is wrong
– Alexander Mills
Feb 20 '17 at 21:55
@AlexanderMills The reason these files exist is because Mac ripped them straight outta Unix. There's no reason they all shouldn't be loaded for a user.
– RaisinBranCrunch
Feb 7 at 21:35
you can get circular calls if they load each other, is the problem, best way to avoid that is to flip a boolean with an env var and only load the other files if the boolean is not set.
– Alexander Mills
Feb 7 at 22:03
add a comment |
On my 10.6 machine ~/.profile
is sourced. So a source .bashrc
entry in ~/.profile
should do the job.
Worked for me on Mac OS El Capitan.
– user674669
Jun 15 '16 at 20:56
My experience says you do not want to source one .bashx file from another, they are separate for a reason :) If you are doing that, then something is wrong
– Alexander Mills
Feb 20 '17 at 21:55
@AlexanderMills The reason these files exist is because Mac ripped them straight outta Unix. There's no reason they all shouldn't be loaded for a user.
– RaisinBranCrunch
Feb 7 at 21:35
you can get circular calls if they load each other, is the problem, best way to avoid that is to flip a boolean with an env var and only load the other files if the boolean is not set.
– Alexander Mills
Feb 7 at 22:03
add a comment |
On my 10.6 machine ~/.profile
is sourced. So a source .bashrc
entry in ~/.profile
should do the job.
On my 10.6 machine ~/.profile
is sourced. So a source .bashrc
entry in ~/.profile
should do the job.
answered Aug 7 '11 at 6:08
sebastiangeigersebastiangeiger
20127
20127
Worked for me on Mac OS El Capitan.
– user674669
Jun 15 '16 at 20:56
My experience says you do not want to source one .bashx file from another, they are separate for a reason :) If you are doing that, then something is wrong
– Alexander Mills
Feb 20 '17 at 21:55
@AlexanderMills The reason these files exist is because Mac ripped them straight outta Unix. There's no reason they all shouldn't be loaded for a user.
– RaisinBranCrunch
Feb 7 at 21:35
you can get circular calls if they load each other, is the problem, best way to avoid that is to flip a boolean with an env var and only load the other files if the boolean is not set.
– Alexander Mills
Feb 7 at 22:03
add a comment |
Worked for me on Mac OS El Capitan.
– user674669
Jun 15 '16 at 20:56
My experience says you do not want to source one .bashx file from another, they are separate for a reason :) If you are doing that, then something is wrong
– Alexander Mills
Feb 20 '17 at 21:55
@AlexanderMills The reason these files exist is because Mac ripped them straight outta Unix. There's no reason they all shouldn't be loaded for a user.
– RaisinBranCrunch
Feb 7 at 21:35
you can get circular calls if they load each other, is the problem, best way to avoid that is to flip a boolean with an env var and only load the other files if the boolean is not set.
– Alexander Mills
Feb 7 at 22:03
Worked for me on Mac OS El Capitan.
– user674669
Jun 15 '16 at 20:56
Worked for me on Mac OS El Capitan.
– user674669
Jun 15 '16 at 20:56
My experience says you do not want to source one .bashx file from another, they are separate for a reason :) If you are doing that, then something is wrong
– Alexander Mills
Feb 20 '17 at 21:55
My experience says you do not want to source one .bashx file from another, they are separate for a reason :) If you are doing that, then something is wrong
– Alexander Mills
Feb 20 '17 at 21:55
@AlexanderMills The reason these files exist is because Mac ripped them straight outta Unix. There's no reason they all shouldn't be loaded for a user.
– RaisinBranCrunch
Feb 7 at 21:35
@AlexanderMills The reason these files exist is because Mac ripped them straight outta Unix. There's no reason they all shouldn't be loaded for a user.
– RaisinBranCrunch
Feb 7 at 21:35
you can get circular calls if they load each other, is the problem, best way to avoid that is to flip a boolean with an env var and only load the other files if the boolean is not set.
– Alexander Mills
Feb 7 at 22:03
you can get circular calls if they load each other, is the problem, best way to avoid that is to flip a boolean with an env var and only load the other files if the boolean is not set.
– Alexander Mills
Feb 7 at 22:03
add a comment |
Easy fix.
1. Open your ~/.zshrc
file
2. Add the following line at the end of the file.
source ~/.bash_profile
1
Brilliant! That did it for me. It never occurred to me that zsh was getting in the way after I installed Oh-my-zh.
– Cindy Conway
Apr 19 '18 at 14:34
add a comment |
Easy fix.
1. Open your ~/.zshrc
file
2. Add the following line at the end of the file.
source ~/.bash_profile
1
Brilliant! That did it for me. It never occurred to me that zsh was getting in the way after I installed Oh-my-zh.
– Cindy Conway
Apr 19 '18 at 14:34
add a comment |
Easy fix.
1. Open your ~/.zshrc
file
2. Add the following line at the end of the file.
source ~/.bash_profile
Easy fix.
1. Open your ~/.zshrc
file
2. Add the following line at the end of the file.
source ~/.bash_profile
answered Aug 18 '17 at 20:09
Manoj ShresthaManoj Shrestha
44154
44154
1
Brilliant! That did it for me. It never occurred to me that zsh was getting in the way after I installed Oh-my-zh.
– Cindy Conway
Apr 19 '18 at 14:34
add a comment |
1
Brilliant! That did it for me. It never occurred to me that zsh was getting in the way after I installed Oh-my-zh.
– Cindy Conway
Apr 19 '18 at 14:34
1
1
Brilliant! That did it for me. It never occurred to me that zsh was getting in the way after I installed Oh-my-zh.
– Cindy Conway
Apr 19 '18 at 14:34
Brilliant! That did it for me. It never occurred to me that zsh was getting in the way after I installed Oh-my-zh.
– Cindy Conway
Apr 19 '18 at 14:34
add a comment |
On my 10.9 machine ~/.bash_profile is sourced. So a source .bashrc entry in ~/.bash_profile should do the job.
add a comment |
On my 10.9 machine ~/.bash_profile is sourced. So a source .bashrc entry in ~/.bash_profile should do the job.
add a comment |
On my 10.9 machine ~/.bash_profile is sourced. So a source .bashrc entry in ~/.bash_profile should do the job.
On my 10.9 machine ~/.bash_profile is sourced. So a source .bashrc entry in ~/.bash_profile should do the job.
answered Mar 26 '14 at 3:19
Kit HoKit Ho
1,48232341
1,48232341
add a comment |
add a comment |
Put your alias definitions in the bash profile file, you have to create the file but it will be sourced automatically. I create a separate file called alias.configuration and source it in .bash_profile just because I have another user defined and want to have the same alias set.
1
Actually neither.bashrc
nor.bash_profile
are sourced.
– Computist
Aug 7 '11 at 6:02
add a comment |
Put your alias definitions in the bash profile file, you have to create the file but it will be sourced automatically. I create a separate file called alias.configuration and source it in .bash_profile just because I have another user defined and want to have the same alias set.
1
Actually neither.bashrc
nor.bash_profile
are sourced.
– Computist
Aug 7 '11 at 6:02
add a comment |
Put your alias definitions in the bash profile file, you have to create the file but it will be sourced automatically. I create a separate file called alias.configuration and source it in .bash_profile just because I have another user defined and want to have the same alias set.
Put your alias definitions in the bash profile file, you have to create the file but it will be sourced automatically. I create a separate file called alias.configuration and source it in .bash_profile just because I have another user defined and want to have the same alias set.
answered Aug 7 '11 at 3:25
user882385
1
Actually neither.bashrc
nor.bash_profile
are sourced.
– Computist
Aug 7 '11 at 6:02
add a comment |
1
Actually neither.bashrc
nor.bash_profile
are sourced.
– Computist
Aug 7 '11 at 6:02
1
1
Actually neither
.bashrc
nor .bash_profile
are sourced.– Computist
Aug 7 '11 at 6:02
Actually neither
.bashrc
nor .bash_profile
are sourced.– Computist
Aug 7 '11 at 6:02
add a comment |
On 10.10 and iTerm2 2.0, customized profile
- .bash_rc should work.
- .bash_profile, try "/bin/bash --login" instead of "/bin/bash"
I voted up this answer because it seems to be the only one acknowledging that in OS X,at some point, bash would source ".bash_rc" instead of ".bashrc" . I only came here because I was trying to find out why (and I still don't know).
– Marnix A. van Ammers
Feb 2 '16 at 18:09
add a comment |
On 10.10 and iTerm2 2.0, customized profile
- .bash_rc should work.
- .bash_profile, try "/bin/bash --login" instead of "/bin/bash"
I voted up this answer because it seems to be the only one acknowledging that in OS X,at some point, bash would source ".bash_rc" instead of ".bashrc" . I only came here because I was trying to find out why (and I still don't know).
– Marnix A. van Ammers
Feb 2 '16 at 18:09
add a comment |
On 10.10 and iTerm2 2.0, customized profile
- .bash_rc should work.
- .bash_profile, try "/bin/bash --login" instead of "/bin/bash"
On 10.10 and iTerm2 2.0, customized profile
- .bash_rc should work.
- .bash_profile, try "/bin/bash --login" instead of "/bin/bash"
edited May 5 '15 at 5:15
fixer1234
19k144982
19k144982
answered May 5 '15 at 4:38
zmxzmx
112
112
I voted up this answer because it seems to be the only one acknowledging that in OS X,at some point, bash would source ".bash_rc" instead of ".bashrc" . I only came here because I was trying to find out why (and I still don't know).
– Marnix A. van Ammers
Feb 2 '16 at 18:09
add a comment |
I voted up this answer because it seems to be the only one acknowledging that in OS X,at some point, bash would source ".bash_rc" instead of ".bashrc" . I only came here because I was trying to find out why (and I still don't know).
– Marnix A. van Ammers
Feb 2 '16 at 18:09
I voted up this answer because it seems to be the only one acknowledging that in OS X,at some point, bash would source ".bash_rc" instead of ".bashrc" . I only came here because I was trying to find out why (and I still don't know).
– Marnix A. van Ammers
Feb 2 '16 at 18:09
I voted up this answer because it seems to be the only one acknowledging that in OS X,at some point, bash would source ".bash_rc" instead of ".bashrc" . I only came here because I was trying to find out why (and I still don't know).
– Marnix A. van Ammers
Feb 2 '16 at 18:09
add a comment |
In iTerm2, ensure you're using "login shell" instead of a custom command including "login", which doesn't do what you expect.
What does iTerm2 command actually do?
– studgeek
Apr 9 '16 at 21:24
add a comment |
In iTerm2, ensure you're using "login shell" instead of a custom command including "login", which doesn't do what you expect.
What does iTerm2 command actually do?
– studgeek
Apr 9 '16 at 21:24
add a comment |
In iTerm2, ensure you're using "login shell" instead of a custom command including "login", which doesn't do what you expect.
In iTerm2, ensure you're using "login shell" instead of a custom command including "login", which doesn't do what you expect.
answered Aug 7 '11 at 20:25
GeorgeGeorge
1,336158
1,336158
What does iTerm2 command actually do?
– studgeek
Apr 9 '16 at 21:24
add a comment |
What does iTerm2 command actually do?
– studgeek
Apr 9 '16 at 21:24
What does iTerm2 command actually do?
– studgeek
Apr 9 '16 at 21:24
What does iTerm2 command actually do?
– studgeek
Apr 9 '16 at 21:24
add a comment |
Add
set -x
to the beginning of /etc/profile
. This gives you a line-by-line account of everything that gets executed when bash
starts up, including files sourced from within /etc/profile
, ~/.bash_profile
, etc. It's a bit daunting if you don't understand bash
scripting very well, but you may be able to see if there is an error in a start-up file, and the output will be useful for someone proficient in bash
to help you locate your problem.
You can remove the set -x
line when you're finished troubleshooting.
add a comment |
Add
set -x
to the beginning of /etc/profile
. This gives you a line-by-line account of everything that gets executed when bash
starts up, including files sourced from within /etc/profile
, ~/.bash_profile
, etc. It's a bit daunting if you don't understand bash
scripting very well, but you may be able to see if there is an error in a start-up file, and the output will be useful for someone proficient in bash
to help you locate your problem.
You can remove the set -x
line when you're finished troubleshooting.
add a comment |
Add
set -x
to the beginning of /etc/profile
. This gives you a line-by-line account of everything that gets executed when bash
starts up, including files sourced from within /etc/profile
, ~/.bash_profile
, etc. It's a bit daunting if you don't understand bash
scripting very well, but you may be able to see if there is an error in a start-up file, and the output will be useful for someone proficient in bash
to help you locate your problem.
You can remove the set -x
line when you're finished troubleshooting.
Add
set -x
to the beginning of /etc/profile
. This gives you a line-by-line account of everything that gets executed when bash
starts up, including files sourced from within /etc/profile
, ~/.bash_profile
, etc. It's a bit daunting if you don't understand bash
scripting very well, but you may be able to see if there is an error in a start-up file, and the output will be useful for someone proficient in bash
to help you locate your problem.
You can remove the set -x
line when you're finished troubleshooting.
answered Jul 24 '12 at 21:43
chepnerchepner
4,9451425
4,9451425
add a comment |
add a comment |
Make the following change and iTerm will source bashrc
iTerm > Preferences > General > [x] Command: /bin/bash
add a comment |
Make the following change and iTerm will source bashrc
iTerm > Preferences > General > [x] Command: /bin/bash
add a comment |
Make the following change and iTerm will source bashrc
iTerm > Preferences > General > [x] Command: /bin/bash
Make the following change and iTerm will source bashrc
iTerm > Preferences > General > [x] Command: /bin/bash
answered May 19 '16 at 21:27
jakejake
1
1
add a comment |
add a comment |
I combined couple solutions together to work it like expected.
.bash_profile
source and run on zsh.
Preferences -> Profiles -> General
.
Select Command under Command .
And add in the text box /bin/bash --login
.
Then in .bash_profile add line
/bin/zsh --login
That's it.
(1) What? (2) If you are havingbash
always runzsh
, that is not what anybody expects.
– Scott
Mar 5 '18 at 5:56
If I set /bin/bash --login, it doesn't provide any features of zsh. Then If I change it to loginshell in preference, it doesn't read .bash_profile. Everytime I have to runsource ~/.bash_profile
manually. @Scott After doing the above things, I have zsh in the required way.
– muhammed basil
Mar 5 '18 at 8:07
(1) My point is thatzsh
might be what you desire, but it is not required or asked for by this question, which is tagged [bash] and doesn’t say anything aboutzsh
. (2) If you define aliases and shell functions and set variables (without exporting them) in your.bashrc
and/or.bash_profile
, are they available to you in yourzsh
shell?
– Scott
Mar 5 '18 at 15:32
add a comment |
I combined couple solutions together to work it like expected.
.bash_profile
source and run on zsh.
Preferences -> Profiles -> General
.
Select Command under Command .
And add in the text box /bin/bash --login
.
Then in .bash_profile add line
/bin/zsh --login
That's it.
(1) What? (2) If you are havingbash
always runzsh
, that is not what anybody expects.
– Scott
Mar 5 '18 at 5:56
If I set /bin/bash --login, it doesn't provide any features of zsh. Then If I change it to loginshell in preference, it doesn't read .bash_profile. Everytime I have to runsource ~/.bash_profile
manually. @Scott After doing the above things, I have zsh in the required way.
– muhammed basil
Mar 5 '18 at 8:07
(1) My point is thatzsh
might be what you desire, but it is not required or asked for by this question, which is tagged [bash] and doesn’t say anything aboutzsh
. (2) If you define aliases and shell functions and set variables (without exporting them) in your.bashrc
and/or.bash_profile
, are they available to you in yourzsh
shell?
– Scott
Mar 5 '18 at 15:32
add a comment |
I combined couple solutions together to work it like expected.
.bash_profile
source and run on zsh.
Preferences -> Profiles -> General
.
Select Command under Command .
And add in the text box /bin/bash --login
.
Then in .bash_profile add line
/bin/zsh --login
That's it.
I combined couple solutions together to work it like expected.
.bash_profile
source and run on zsh.
Preferences -> Profiles -> General
.
Select Command under Command .
And add in the text box /bin/bash --login
.
Then in .bash_profile add line
/bin/zsh --login
That's it.
answered Mar 5 '18 at 5:48
muhammed basilmuhammed basil
992
992
(1) What? (2) If you are havingbash
always runzsh
, that is not what anybody expects.
– Scott
Mar 5 '18 at 5:56
If I set /bin/bash --login, it doesn't provide any features of zsh. Then If I change it to loginshell in preference, it doesn't read .bash_profile. Everytime I have to runsource ~/.bash_profile
manually. @Scott After doing the above things, I have zsh in the required way.
– muhammed basil
Mar 5 '18 at 8:07
(1) My point is thatzsh
might be what you desire, but it is not required or asked for by this question, which is tagged [bash] and doesn’t say anything aboutzsh
. (2) If you define aliases and shell functions and set variables (without exporting them) in your.bashrc
and/or.bash_profile
, are they available to you in yourzsh
shell?
– Scott
Mar 5 '18 at 15:32
add a comment |
(1) What? (2) If you are havingbash
always runzsh
, that is not what anybody expects.
– Scott
Mar 5 '18 at 5:56
If I set /bin/bash --login, it doesn't provide any features of zsh. Then If I change it to loginshell in preference, it doesn't read .bash_profile. Everytime I have to runsource ~/.bash_profile
manually. @Scott After doing the above things, I have zsh in the required way.
– muhammed basil
Mar 5 '18 at 8:07
(1) My point is thatzsh
might be what you desire, but it is not required or asked for by this question, which is tagged [bash] and doesn’t say anything aboutzsh
. (2) If you define aliases and shell functions and set variables (without exporting them) in your.bashrc
and/or.bash_profile
, are they available to you in yourzsh
shell?
– Scott
Mar 5 '18 at 15:32
(1) What? (2) If you are having
bash
always run zsh
, that is not what anybody expects.– Scott
Mar 5 '18 at 5:56
(1) What? (2) If you are having
bash
always run zsh
, that is not what anybody expects.– Scott
Mar 5 '18 at 5:56
If I set /bin/bash --login, it doesn't provide any features of zsh. Then If I change it to loginshell in preference, it doesn't read .bash_profile. Everytime I have to run
source ~/.bash_profile
manually. @Scott After doing the above things, I have zsh in the required way.– muhammed basil
Mar 5 '18 at 8:07
If I set /bin/bash --login, it doesn't provide any features of zsh. Then If I change it to loginshell in preference, it doesn't read .bash_profile. Everytime I have to run
source ~/.bash_profile
manually. @Scott After doing the above things, I have zsh in the required way.– muhammed basil
Mar 5 '18 at 8:07
(1) My point is that
zsh
might be what you desire, but it is not required or asked for by this question, which is tagged [bash] and doesn’t say anything about zsh
. (2) If you define aliases and shell functions and set variables (without exporting them) in your .bashrc
and/or .bash_profile
, are they available to you in your zsh
shell?– Scott
Mar 5 '18 at 15:32
(1) My point is that
zsh
might be what you desire, but it is not required or asked for by this question, which is tagged [bash] and doesn’t say anything about zsh
. (2) If you define aliases and shell functions and set variables (without exporting them) in your .bashrc
and/or .bash_profile
, are they available to you in your zsh
shell?– Scott
Mar 5 '18 at 15:32
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f320065%2fbashrc-not-sourced-in-iterm-mac-os-x%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
What's happening is
~/.bash_profile
is being invoked by bash first, which is short circuiting the instructions you have in~/.bashrc
. This problem can happen unexpectedly if a rogue program adds some instructions to your~/.bash_profile
when previously the file didn't exist, and you had placed all your bash commands in~/.bashrc
. The solution is to either delete your ~/.bash_profile, or to have ~/.bash_profile source your ~/.bashrc. This can be performed by adding the command:source ~/.bashrc
to the end of your~/.bash_profile
and restarting the terminal.– Eric Leschinski
Aug 27 '17 at 15:16