~/.bash_profile being executed for non-login shellsDifference between Login Shell and Non-Login Shell?What is...
What word best describes someone who likes to do everything on his own?
Where in ש״ס who one find the adage, “He who suggests the idea should carry it out”?
Why is there a need to prevent a racist, or homophobic, etc. vendor from discriminating who they sell to?
What is the German idiom or expression for when someone is being hypocritical against their own teachings?
Does this put me at risk for identity theft?
Does the length of a password for Wi-Fi affect speed?
What are the examples (applications) of the MIPs in which the objective function has nonzero coefficients for only continuous variables?
Will a paper be retracted if a flaw in released software code invalidates its central idea?
Can ads on a page read my password?
What can make Linux unresponsive for minutes when browsing certain websites?
Why does putting a dot after the URL remove login information?
Can I enter a rental property without giving notice if I'm afraid a tenant may be hurt?
Did silent film actors actually say their lines or did they simply improvise “dialogue” while being filmed?
What city skyline is this picture of?
Is there such thing as a "3-dimensional surface?"
How can I refer to something in a book?
What are these mathematical groups in U.S. universities?
Validation and verification of mathematical models
ESTA declined to the US
Cobb-Douglas production function with expenditures rather than units
Print only the last three columns from file
How do I get the =LEFT function in excel, to also take the number zero as the first number?
How would a family travel from Indiana to Texas in 1911?
Is this cheap "air conditioner" able to cool a room?
~/.bash_profile being executed for non-login shells
Difference between Login Shell and Non-Login Shell?What is the difference between interactive shells, login shells, non-login shell and their use cases?Login script for bash not loadingSet login shell if /etc/shells is missingRun “logout script” for non-login shells.bashrc and .bash_profile not executedlogin/non-login and interactive/non-interactive shellsAre there non-interactive login shells?I have multiple copies of .bash_profile, which one is actually being used? (if any)~/.bash_profile not executed upon login, but ~/.profile is
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
My bash_profile looks like:
takeapic
#print status
#do other stuff
source ~/.bashrc
For some reason, every terminal emulator I call executes this script. Shouldn't it be executed only once, when I login. Why is this happening?
My bashrc contains these commands:
export PATH=$PATH:/home/saga/bin
export VISUAL=vim
export EDITOR=vim
export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33'
alias ls='ls --color=auto'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -al'
alias cx='chmod +x'
alias clipboard='xsel -b'
alias diff='diff --color=auto'
alias grep='grep --color=auto'
alias sakura='sakura -e tmux'
alias zathura='zathura --fork'
export HISTCONTROL=ignoredupd
I understand tmux starts every pane as a login shell, but sakura executes .bash_profile even when I call it by it's path.
bash shell login bashrc
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
My bash_profile looks like:
takeapic
#print status
#do other stuff
source ~/.bashrc
For some reason, every terminal emulator I call executes this script. Shouldn't it be executed only once, when I login. Why is this happening?
My bashrc contains these commands:
export PATH=$PATH:/home/saga/bin
export VISUAL=vim
export EDITOR=vim
export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33'
alias ls='ls --color=auto'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -al'
alias cx='chmod +x'
alias clipboard='xsel -b'
alias diff='diff --color=auto'
alias grep='grep --color=auto'
alias sakura='sakura -e tmux'
alias zathura='zathura --fork'
export HISTCONTROL=ignoredupd
I understand tmux starts every pane as a login shell, but sakura executes .bash_profile even when I call it by it's path.
bash shell login bashrc
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Most of the terminal emulators do login.
– Ipor Sircer
Nov 28 '16 at 18:03
I use sakura as terminal emulator. It's man page says it should be given '-l' while calling it for it to behave as a login shell.
– saga
Nov 28 '16 at 18:07
add a comment |
My bash_profile looks like:
takeapic
#print status
#do other stuff
source ~/.bashrc
For some reason, every terminal emulator I call executes this script. Shouldn't it be executed only once, when I login. Why is this happening?
My bashrc contains these commands:
export PATH=$PATH:/home/saga/bin
export VISUAL=vim
export EDITOR=vim
export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33'
alias ls='ls --color=auto'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -al'
alias cx='chmod +x'
alias clipboard='xsel -b'
alias diff='diff --color=auto'
alias grep='grep --color=auto'
alias sakura='sakura -e tmux'
alias zathura='zathura --fork'
export HISTCONTROL=ignoredupd
I understand tmux starts every pane as a login shell, but sakura executes .bash_profile even when I call it by it's path.
bash shell login bashrc
My bash_profile looks like:
takeapic
#print status
#do other stuff
source ~/.bashrc
For some reason, every terminal emulator I call executes this script. Shouldn't it be executed only once, when I login. Why is this happening?
My bashrc contains these commands:
export PATH=$PATH:/home/saga/bin
export VISUAL=vim
export EDITOR=vim
export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33'
alias ls='ls --color=auto'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -al'
alias cx='chmod +x'
alias clipboard='xsel -b'
alias diff='diff --color=auto'
alias grep='grep --color=auto'
alias sakura='sakura -e tmux'
alias zathura='zathura --fork'
export HISTCONTROL=ignoredupd
I understand tmux starts every pane as a login shell, but sakura executes .bash_profile even when I call it by it's path.
bash shell login bashrc
bash shell login bashrc
edited Nov 28 '16 at 18:10
saga
asked Nov 28 '16 at 17:58
sagasaga
8112 silver badges26 bronze badges
8112 silver badges26 bronze badges
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 1 hour ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Most of the terminal emulators do login.
– Ipor Sircer
Nov 28 '16 at 18:03
I use sakura as terminal emulator. It's man page says it should be given '-l' while calling it for it to behave as a login shell.
– saga
Nov 28 '16 at 18:07
add a comment |
Most of the terminal emulators do login.
– Ipor Sircer
Nov 28 '16 at 18:03
I use sakura as terminal emulator. It's man page says it should be given '-l' while calling it for it to behave as a login shell.
– saga
Nov 28 '16 at 18:07
Most of the terminal emulators do login.
– Ipor Sircer
Nov 28 '16 at 18:03
Most of the terminal emulators do login.
– Ipor Sircer
Nov 28 '16 at 18:03
I use sakura as terminal emulator. It's man page says it should be given '-l' while calling it for it to behave as a login shell.
– saga
Nov 28 '16 at 18:07
I use sakura as terminal emulator. It's man page says it should be given '-l' while calling it for it to behave as a login shell.
– saga
Nov 28 '16 at 18:07
add a comment |
1 Answer
1
active
oldest
votes
Actually bash documentation says
Invoked as an interactive non-login shell
When an interactive shell that is not a login shell is started, Bash reads and executes commands from ~/.bashrc, if that file exists.
So it's a expected behaviour
Source : http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files
1
Yes, it executes ~/.bashrc nicely. The problem is that it executes ~/.bash_profile as well, for non-login shells. Which shouldn't happen.
– saga
Nov 28 '16 at 19:39
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f326629%2fbash-profile-being-executed-for-non-login-shells%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Actually bash documentation says
Invoked as an interactive non-login shell
When an interactive shell that is not a login shell is started, Bash reads and executes commands from ~/.bashrc, if that file exists.
So it's a expected behaviour
Source : http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files
1
Yes, it executes ~/.bashrc nicely. The problem is that it executes ~/.bash_profile as well, for non-login shells. Which shouldn't happen.
– saga
Nov 28 '16 at 19:39
add a comment |
Actually bash documentation says
Invoked as an interactive non-login shell
When an interactive shell that is not a login shell is started, Bash reads and executes commands from ~/.bashrc, if that file exists.
So it's a expected behaviour
Source : http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files
1
Yes, it executes ~/.bashrc nicely. The problem is that it executes ~/.bash_profile as well, for non-login shells. Which shouldn't happen.
– saga
Nov 28 '16 at 19:39
add a comment |
Actually bash documentation says
Invoked as an interactive non-login shell
When an interactive shell that is not a login shell is started, Bash reads and executes commands from ~/.bashrc, if that file exists.
So it's a expected behaviour
Source : http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files
Actually bash documentation says
Invoked as an interactive non-login shell
When an interactive shell that is not a login shell is started, Bash reads and executes commands from ~/.bashrc, if that file exists.
So it's a expected behaviour
Source : http://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files
answered Nov 28 '16 at 19:26
Diego RocciaDiego Roccia
5442 silver badges6 bronze badges
5442 silver badges6 bronze badges
1
Yes, it executes ~/.bashrc nicely. The problem is that it executes ~/.bash_profile as well, for non-login shells. Which shouldn't happen.
– saga
Nov 28 '16 at 19:39
add a comment |
1
Yes, it executes ~/.bashrc nicely. The problem is that it executes ~/.bash_profile as well, for non-login shells. Which shouldn't happen.
– saga
Nov 28 '16 at 19:39
1
1
Yes, it executes ~/.bashrc nicely. The problem is that it executes ~/.bash_profile as well, for non-login shells. Which shouldn't happen.
– saga
Nov 28 '16 at 19:39
Yes, it executes ~/.bashrc nicely. The problem is that it executes ~/.bash_profile as well, for non-login shells. Which shouldn't happen.
– saga
Nov 28 '16 at 19:39
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f326629%2fbash-profile-being-executed-for-non-login-shells%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
Most of the terminal emulators do login.
– Ipor Sircer
Nov 28 '16 at 18:03
I use sakura as terminal emulator. It's man page says it should be given '-l' while calling it for it to behave as a login shell.
– saga
Nov 28 '16 at 18:07