Re: bashrc problem
Thanks a lot @Will Mengarini On Wed, Jan 12, 2022 at 8:21 PM Will Mengarini wrote: > * Yamada??? [22-01/12=We 20:10 +0800]: > > Do you mean if .bash_profile exists, .bashrc will be ignored? > > Sometimes. From `man bash`: > When bash is invoked as an interactive login shell, or as a > non-interactive shell with the --login option, it first reads > and executes commands from the file /etc/profile, if that file > exists. After reading that file, it looks for ~/.bash_profile, > ~/.bash_login, and ~/.profile, in that order, and reads and > executes commands from the first one that exists and is readable. > [...] > When an interactive shell that is not a login shell > is started, bash reads and executes commands from > /etc/bash.bashrc and ~/.bashrc, if these files exist. > > * Yamada??? [22-01/12=We 19:49 +0800]: > >>> I have a .bashrc file in my home dir, whose content is shown as > follows. > >>> But every time I log into the system, I have to source this file by > hand. > >>> > >>> $ which scala > >>> /usr/bin/scala > >>> > >>> $ cat .bashrc > >>> #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! > >>> export SDKMAN_DIR="$HOME/.sdkman" > >>> [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source \ > >>> "$HOME/.sdkman/bin/sdkman-init.sh" > >>> > >>> $ . .bashrc > >>> $ which scala > >>> /home/xxx/.sdkman/candidates/scala/current/bin/scala > >>> > >>> How can I make it take effect automatically after I login the system? > > On Wed, Jan 12, 2022 at 8:07 PM Will Mengarini wrote: > >> > >> Check whether you have either ~/.bash_profile or ~/.profile. > >> > >> If ~/.bash_profile, the line > >> . ~/.bashrc > >> will suffice. > >> > >> If ~/.profile, use > >> # if running bash > >> if [ -n "$BASH_VERSION" ]; then > >> # include .bashrc if it exists > >> if [ -f ~/.bashrc ]; then > >> . ~/.bashrc > >> fi > >> fi > >> in case you someday want to try other shells. >
Re: bashrc problem
* Yamada??? [22-01/12=We 20:10 +0800]: > Do you mean if .bash_profile exists, .bashrc will be ignored? Sometimes. From `man bash`: When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. [...] When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist. * Yamada??? [22-01/12=We 19:49 +0800]: >>> I have a .bashrc file in my home dir, whose content is shown as follows. >>> But every time I log into the system, I have to source this file by hand. >>> >>> $ which scala >>> /usr/bin/scala >>> >>> $ cat .bashrc >>> #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! >>> export SDKMAN_DIR="$HOME/.sdkman" >>> [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source \ >>> "$HOME/.sdkman/bin/sdkman-init.sh" >>> >>> $ . .bashrc >>> $ which scala >>> /home/xxx/.sdkman/candidates/scala/current/bin/scala >>> >>> How can I make it take effect automatically after I login the system? On Wed, Jan 12, 2022 at 8:07 PM Will Mengarini wrote: >> >> Check whether you have either ~/.bash_profile or ~/.profile. >> >> If ~/.bash_profile, the line >> . ~/.bashrc >> will suffice. >> >> If ~/.profile, use >> # if running bash >> if [ -n "$BASH_VERSION" ]; then >> # include .bashrc if it exists >> if [ -f ~/.bashrc ]; then >> . ~/.bashrc >> fi >> fi >> in case you someday want to try other shells.
Re: bashrc problem
* Yamada??? [22-01/12=We 19:49 +0800]: > I have a .bashrc file in my home dir, whose content is shown as follows. > But every time I log into the system, I have to source this file by hand. > > $ which scala > /usr/bin/scala > > $ cat .bashrc > #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! > export SDKMAN_DIR="$HOME/.sdkman" > [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source \ > "$HOME/.sdkman/bin/sdkman-init.sh" > > $ . .bashrc > $ which scala > /home/xxx/.sdkman/candidates/scala/current/bin/scala > > How can I make it take effect automatically after I login the system? Check whether you have either ~/.bash_profile or ~/.profile. If ~/.bash_profile, the line . ~/.bashrc will suffice. If ~/.profile, use # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f ~/.bashrc ]; then . ~/.bashrc fi fi in case you someday want to try other shells.
Re: bashrc problem
Do you mean if .bash_profile exists, .bashrc will be ignored? Thanks. On Wed, Jan 12, 2022 at 8:07 PM Will Mengarini wrote: > * Yamada??? [22-01/12=We 19:49 +0800]: > > I have a .bashrc file in my home dir, whose content is shown as follows. > > But every time I log into the system, I have to source this file by hand. > > > > $ which scala > > /usr/bin/scala > > > > $ cat .bashrc > > #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! > > export SDKMAN_DIR="$HOME/.sdkman" > > [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source \ > > "$HOME/.sdkman/bin/sdkman-init.sh" > > > > $ . .bashrc > > $ which scala > > /home/xxx/.sdkman/candidates/scala/current/bin/scala > > > > How can I make it take effect automatically after I login the system? > > Check whether you have either ~/.bash_profile or ~/.profile. > > If ~/.bash_profile, the line > . ~/.bashrc > will suffice. > > If ~/.profile, use > # if running bash > if [ -n "$BASH_VERSION" ]; then > # include .bashrc if it exists > if [ -f ~/.bashrc ]; then > . ~/.bashrc > fi > fi > in case you someday want to try other shells. >
bashrc problem
Hello list I have a .bashrc file in my home dir, whose content is shown as follows. But every time I log into the system, I have to source this file by hand. $ which scala /usr/bin/scala $ cat .bashrc #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! export SDKMAN_DIR="$HOME/.sdkman" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" $ . .bashrc $ which scala /home/xxx/.sdkman/candidates/scala/current/bin/scala How can I make it take effect automatically after I login the system? ありがとう Yamada
Re: Strange .bashrc Problem
Thanks for the reply. Adding the lines from your .bash_profile to mine restored the functionality of .bashrc. I don't have any backups of .bash_profile, but I would guess the the HEX installation script woped out the origional .bash_profile. ( I try to never assume anything as we all know how that work can be parsed). An any rate, my thanks for the answers. The assistance that is so forthcoming is one of the things that makes Linux the OS of choice! On 04/25/2018 03:40 PM, Andy Smith wrote: Hello, On Wed, Apr 25, 2018 at 03:34:02PM -0400, Stephen P. Molnar wrote: Whie the additional lines are necessary for the execution of HEX they seem to have wiped oour all of the alias entries I have in .bashrc. Rebooting the system does not eliminate the problem! Bu bumbling about I discovered the it is necessary to source .bashrc inorder to recticate the alias lines in .bashrc (note: commenting out the added lines in .bash_profile did not solve the problem). My .bash_profile contains: # include .bashrc if it exists if [ -f ~/.bashrc ]; then . ~/.bashrc fi Does yours (still)? Maybe you could compare your ,bash_profile now to one from your recent backups. Cheers, Andy -- Stephen P. Molnar, Ph.D. Consultant www.molecular-modeling.net (614)312-7528 (c) Skype: smolnar1
Re: Strange .bashrc Problem
On Wed, Apr 25, 2018 at 10:49:52PM +0300, Abdullah Ramazanoglu wrote: > It seems like when ~/.bash_profile did not exist, then ~/.bashrc is called > directly. That's not correct. As a LOGIN shell, bash reads ONE file, searching among the following items in sequence: a) ~/.bash_profile b) ~/.bash_login c) ~/.profile Whichever one it finds first, that's what it reads. If you also want it to read ~/.bashrc (you DO want this), then you must ensure that ~/.bashrc gets sourced/dotted from whatever file bash DOES read. > I gather that you had no ~/.bash_profile prior to installing HEX. That's my guess as well. > So I would suggest simply sourcing ~/.bashrc at the last line of > ~/.bash_profile If he has other stuff in ~/.profile then he may want to source ~/.profile instead. Then ~/.profile can source ~/.bashrc and everything should be back to normal.
Re: Strange .bashrc Problem
On Wed, Apr 25, 2018 at 03:34:02PM -0400, Stephen P. Molnar wrote: > Bu bumbling about I discovered > the it is necessary to source .bashrc inorder to recticate the alias lines > in .bashrc (note: commenting out the added lines in .bash_profile did not > solve the problem). > > What's going on what is the fix? It is normal and expected that you must source (or dot in) ~/.bashrc from your ~/.bash_profile or ~/.profile. If this previously worked for you and then STOPPED working when you installed HEX, then two possible things come to mind: 1) Installing HEX somehow removed the ". ~/.bashrc" code from your profile. 2) Installing HEX created a ~/.bash_profile that previously did not exist. Before this, you were using ~/.profile which is what Debian creates in a default stretch install. #2 seems more likely to me. If that's the case, then perhaps what you want to do is source ~/.profile from your ~/.bash_profile. Or perhaps you would prefer to merge the two into a single file. A lot will depend on how you believe HEX will handle future upgrades. Will it search for its installed content in your ~/.bash_profile and blindly append its content to ~/.bash_profile if it doesn't see it? Even if the content is actually in ~/.profile instead?
Re: Strange .bashrc Problem
On Wed, 25 Apr 2018 15:34:02 -0400 Stephen P. Molnar said: > What's going on what is the fix? It seems like when ~/.bash_profile did not exist, then ~/.bashrc is called directly. However, when ~/.bash_profile did exist, then it is called *instead of* ~/.bashrc and it is up to ~/.bash_profile to source ~/.bashrc or not. I gather that you had no ~/.bash_profile prior to installing HEX. So I would suggest simply sourcing ~/.bashrc at the last line of ~/.bash_profile Regards -- Abdullah Ramazanoglu
Re: Strange .bashrc Problem
Hello, On Wed, Apr 25, 2018 at 03:34:02PM -0400, Stephen P. Molnar wrote: > Whie the additional lines are necessary for the execution of HEX they seem > to have wiped oour all of the alias entries I have in .bashrc. Rebooting > the system does not eliminate the problem! Bu bumbling about I discovered > the it is necessary to source .bashrc inorder to recticate the alias lines > in .bashrc (note: commenting out the added lines in .bash_profile did not > solve the problem). My .bash_profile contains: # include .bashrc if it exists if [ -f ~/.bashrc ]; then . ~/.bashrc fi Does yours (still)? Maybe you could compare your ,bash_profile now to one from your recent backups. Cheers, Andy -- https://bitfolk.com/ -- No-nonsense VPS hosting
Strange .bashrc Problem
I am running Debian Stretch on my 64-bit Linux platform. I have just installed the molecular docking program HEX. The installation program added the line shown below to .bash_profile: # # Lines added by 'hex_setup.bin' for Hex 8.0.0 # export HEX_ROOT=/home/comp/Apps/Hex export HEX_VERSION=8.0.0 export PATH=${PATH}:${HEX_ROOT}/bin export HEX_CACHE=/home/comp/Apps/Hex/hex_cache Whie the additional lines are necessary for the execution of HEX they seem to have wiped oour all of the alias entries I have in .bashrc. Rebooting the system does not eliminate the problem! Bu bumbling about I discovered the it is necessary to source .bashrc inorder to recticate the alias lines in .bashrc (note: commenting out the added lines in .bash_profile did not solve the problem). What's going on what is the fix? Thanks in advance. -- Stephen P. Molnar, Ph.D. Consultant www.molecular-modeling.net (614)312-7528 (c) Skype: smolnar1
Re: .bashrc problem--ls output and root prompt
On Tue, Aug 21, 2007 at 04:14:04PM -0700, Dr. Jennifer Nussbaum wrote: PS1='\h\w $ '; export PS1 So, nothing fancy. How do i get my coloured ls back, and my # prompt as sudo'ed root? Use \$ rather than a plain $ to get # as root. A. -- Ansgar Esztermann Researcher Sysadmin http://www.mpibpc.mpg.de/groups/grubmueller/start/people/aeszter/index.shtml pgpOVGmgXgxwy.pgp Description: PGP signature
.bashrc problem--ls output and root prompt
Im a new Debian Etch user, coming from FreeBSD. When i first installed my system, running the ls command would give me coloured output (executables one colour, directories another). Also, when I sudo'ed to root, i would get the usual # prompt as root. I then copied over my (straightforward) .bashrc file, and now i dont have the colored output and sudoing to root leaves me with a $ prompt. (I do reset my PS1 line, but i dont know how to have a different one for root, keeping the #.) Can someone give me a suggestion? My complete .bashrc, less comments, and with my CVSROOT masked, is: --- PS1='\h\w $ '; export PS1 BLOCKSIZE=K;export BLOCKSIZE EDITOR=emacs; export EDITOR CVS_RSH=ssh; export CVS_RSH CVSROOT= [HIDDEN]; export CVSROOT PATH=${PATH}:/sbin:/usr/sbin --- So, nothing fancy. How do i get my coloured ls back, and my # prompt as sudo'ed root? Thanks, Jen Pinpoint customers who are looking for what you sell. http://searchmarketing.yahoo.com/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: .bashrc problem--ls output and root prompt
2007/8/21, Dr. Jennifer Nussbaum [EMAIL PROTECTED]: Im a new Debian Etch user, coming from FreeBSD. When i first installed my system, running the ls command would give me coloured output (executables one colour, directories another). Also, when I sudo'ed to root, i would get the usual # prompt as root. I then copied over my (straightforward) .bashrc file, and now i dont have the colored output and sudoing to root leaves me with a $ prompt. (I do reset my PS1 line, but i dont know how to have a different one for root, keeping the #.) Can someone give me a suggestion? My complete .bashrc, less comments, and with my CVSROOT masked, is: --- PS1='\h\w $ '; export PS1 BLOCKSIZE=K;export BLOCKSIZE EDITOR=emacs; export EDITOR CVS_RSH=ssh; export CVS_RSH CVSROOT= [HIDDEN]; export CVSROOT PATH=${PATH}:/sbin:/usr/sbin --- So, nothing fancy. How do i get my coloured ls back, and my # prompt as sudo'ed root? Hi, try to add: alias ls='ls --color=auto' Best regards, Sergio Cuellar -- Meine Hoffnung soll mich leiten Durch die Tage ohne Dich Und die Liebe soll mich tragen Wenn der Schmerz die Hoffnung bricht -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]