Comments (4)
Thank you for the information. So ~/.bashrc
is sourced from two different places. One place is /etc/profile
. The other place is ~/.bash_profile
. OMB creates ~/.bash_profile
if it doesn't exist because missing ~/.bash_profile
causes problems in macOS.
What is your distribution? I'd say /etc/profile
sourcing ~/.bashrc
is strange. As described in Bash Reference Manual [1] and other places [2,3], ~/.bashrc
is supposed to be sourced from ~/.bash_profile
. So /etc/profile
is not supposed to source ~/.bashrc
.
- [1] Bash Startup Files (Bash Reference Manual)
- [2] bash - Difference between .bashrc and .bash_profile - Super User
- [3] unix - Choosing between .bashrc, .profile, .bash_profile, etc - Super User
I searched. For example, openSUSE /etc/profile
seems to source ~/.bashrc
. I have to say the default Bash configurations of openSUSE have been causing problems constantly. It's not maintained well. Maybe the ideal solution is to fix the setup in the distribution, but I'd anticipate that it would be difficult because there are existing users assuming the strange setup of the distributions.
This time, I think you can just comment out the "source ~/.bashrc
" part of your ~/.bash_profile
.
from oh-my-bash.
Sorry for the slow reply. I was busy last week, and I don't have an idea what could cause the behavior in your environment. I need to collect information. What would be the result if you replace echo "Hello $USER"
in the above test code as follows?
if [[ $(hostname) != "vlgsplts02" ]] && [[ $(hostname) != "dlm-lts01" ]]; then
- echo "Hello $USER"
+ declare -p BASHPID BASH_SOURCE BASH_LINENO >&2
fi
from oh-my-bash.
Thanks for your reply and your support in analyzing this issue.
After modifying .bashrc
I get this output:
declare -ir BASHPID="20144"
declare -a BASH_SOURCE=([0]="/sapmnt/HOME/d038783/.bashrc" [1]="/etc/profile")
declare -a BASH_LINENO=([0]="349" [1]="0")
declare -ir BASHPID="20144"
declare -a BASH_SOURCE=([0]="/sapmnt/HOME/d038783/.bashrc" [1]="/sapmnt/HOME/d038783/.bash_profile")
declare -a BASH_LINENO=([0]="5" [1]="0")
Can you conclude from this output why .bashrc
is running twice?
from oh-my-bash.
Actually I'm running SLES, but this should be equal to openSUSE.
However I was using a customized ~/.bashrc
before deploying oh-my-bash, and this error was not showing up.
I will now modify ~/.bash_profile
and verify if this is working.
Update:
Removing source ~/.bashrc
from ~/.bashrc
is the solution.
from oh-my-bash.
Related Issues (20)
- problems with cd on sshfs mounted directory with git repositories HOT 2
- Problems with tmux > detaching or killing session HOT 1
- Allow for a way to not alter bash files directly, but to make changes that can be sourced HOT 3
- Robby russell theme issue HOT 2
- How to use "U+e0b6" () at the beginning of the prompt? HOT 1
- How to autocomplete the files with lsd instead of ls? HOT 1
- sudo: _omb_util_alias_init_mv: command not found HOT 5
- how to show the directory where the command was executed HOT 7
- Custom git completion does not work as expected HOT 12
- Completion broken when sourcing file HOT 13
- Theme not being applied HOT 2
- Sin soporte para venv-conda
- Modifying git-prompt.sh does not take effect HOT 1
- lambda theme for oh my bash HOT 1
- The `DISABLE_UPDATE_PROMPT=true` on `~/.bashrc` doesn't work. HOT 4
- Theme: wanelo throws error HOT 1
- ssh completion doesn't include global ssh hosts HOT 1
- How to change time from 12H to 24H. HOT 3
- Is there anyway to use this when my .bashrc is a symlink to a global .bashrc in my org?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oh-my-bash.