[opensuse-factory] shell not reading .bashrc
Tw up to date Just started a crontab edit and mcedit started. I have in ~/.bashrc "export EDITOR=/usr/bin/joe" and have for a looong time. Why is ~/.bashrc not being read on a new shell or, if it is being read, why is the environment not being set as designated? baffled -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* Patrick Shanahan
Tw up to date
Just started a crontab edit and mcedit started. I have in ~/.bashrc "export EDITOR=/usr/bin/joe" and have for a looong time. Why is ~/.bashrc not being read on a new shell or, if it is being read, why is the environment not being set as designated?
baffled
ps: ~/.bashrc *is* being read, but the editor not set ??? -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2015-07-04 02:13, Patrick Shanahan wrote:
baffled
ps: ~/.bashrc *is* being read, but the editor not set ???
Try create a new user, and see there which is the default editor. If it is "vi", then it is something you changed on your user. If it is "mcedit", then it is some new default or behaviour... - -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAlWXJdEACgkQja8UbcUWM1ztzwEAoAGDzBzvipH1Ew0YNoASN5p+ 1TrlMlC/oRhVNN3ppkkA/2dWvcAhJ7XSAUpHCk9rgrD2YGv4WCMAYLrDLNN1vPKt =mvP4 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2015-07-04 02:16, Carlos E. R. wrote:
On 2015-07-04 02:13, Patrick Shanahan wrote:
baffled
ps: ~/.bashrc *is* being read, but the editor not set ???
Try create a new user, and see there which is the default editor. If it is "vi", then it is something you changed on your user. If it is "mcedit", then it is some new default or behaviour...
Or a system wide setting, I forgot. - -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAlWXJ2gACgkQja8UbcUWM1wYHQD/SaP4THVG+lxjoZShU1lEZIul Xcy2TW31JQSUmJNs73ABAJEOejhx/4WcFZ1L+H+KzNiiyee1QI6ycduaWpHEHqDO =eRuZ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* Carlos E. R.
On 2015-07-04 02:16, Carlos E. R. wrote:
On 2015-07-04 02:13, Patrick Shanahan wrote:
baffled
ps: ~/.bashrc *is* being read, but the editor not set ???
Try create a new user, and see there which is the default editor. If it is "vi", then it is something you changed on your user. If it is "mcedit", then it is some new default or behaviour...
Or a system wide setting, I forgot.
On a new user with no environment changes, echo $EDITOR privides /usr/bin/mcedit. On an old user with "export EDITOR=/usr/bin/joe" in .bashrc, editor is listed as /usr/bin/mcedit ??? something smells bad :( -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 07/03/2015 05:23 PM, Carlos E. R. wrote:
On 2015-07-04 02:16, Carlos E. R. wrote:
On 2015-07-04 02:13, Patrick Shanahan wrote:
baffledthe environment
ps: ~/.bashrc *is* being read, but the editor not set ???
Try create a new user, and see there which is the default editor. If it is "vi", then it is something you changed on your user. If it is "mcedit", then it is some new default or behaviour...
Or a system wide setting, I forgot.
system wide settings (/etc/bash.bashrc) are overridden by personal settings (.bashrc) according to the manpage (crontab 1p) the environment variable EDITOR should control the editor, vi is the default. I would verify that EDITOR is correctly set (echo $EDITOR) I just a few experiments and found that EDITOR was set correctly (I set it to use joe) and crontab -e still used vi. I would tend to suspect that crontab itself is ignoring the variable, not that bash isn't reading .bashrc... And then I did this: export EDITOR=joe crontab -e and got joe as my editor! I'm wondering what happens if I log out and back in -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* Bruce Ferrell
On 07/03/2015 05:23 PM, Carlos E. R. wrote:
On 2015-07-04 02:16, Carlos E. R. wrote:
On 2015-07-04 02:13, Patrick Shanahan wrote:
baffledthe environment
ps: ~/.bashrc *is* being read, but the editor not set ???
Try create a new user, and see there which is the default editor. If it is "vi", then it is something you changed on your user. If it is "mcedit", then it is some new default or behaviour...
Or a system wide setting, I forgot.
system wide settings (/etc/bash.bashrc) are overridden by personal settings (.bashrc)
according to the manpage (crontab 1p) the environment variable EDITOR should control the editor, vi is the default.
I would verify that EDITOR is correctly set (echo $EDITOR)
I just a few experiments and found that EDITOR was set correctly (I set it to use joe) and crontab -e still used vi.
I would tend to suspect that crontab itself is ignoring the variable, not that bash isn't reading .bashrc...
And then I did this:
export EDITOR=joe crontab -e
and got joe as my editor!
I'm wondering what happens if I log out and back in
Do it and see. I find that the editor returns to mcedit. I can export joe as the editor and it is used, but it is not exported from .bashrc. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 07/03/2015 06:05 PM, Bruce Ferrell wrote:
On 07/03/2015 05:23 PM, Carlos E. R. wrote:
On 2015-07-04 02:16, Carlos E. R. wrote:
On 2015-07-04 02:13, Patrick Shanahan wrote:
baffledthe environment ps: ~/.bashrc *is* being read, but the editor not set ??? Try create a new user, and see there which is the default editor. If it is "vi", then it is something you changed on your user. If it is "mcedit", then it is some new default or behaviour... Or a system wide setting, I forgot.
system wide settings (/etc/bash.bashrc) are overridden by personal settings (.bashrc)
according to the manpage (crontab 1p) the environment variable EDITOR should control the editor, vi is the default.
I would verify that EDITOR is correctly set (echo $EDITOR)
I just a few experiments and found that EDITOR was set correctly (I set it to use joe) and crontab -e still used vi.
I would tend to suspect that crontab itself is ignoring the variable, not that bash isn't reading .bashrc...
And then I did this:
export EDITOR=joe crontab -e
and got joe as my editor!
I'm wondering what happens if I log out and back in
And the winner is... When the syntax in .bashrc is: EDITOR=/usr/bin/joe EDITOR is "set" and not available i.e. echo $EDITOR show /usr/bin/joe but it doesn't work EDITOR=/usr/bin/joe export EDITOR or export EDITOR=/usr/bin/joe results in the variable set and usable crontab -e get's joe as it's editor the moral of the story is bash variables must set AND exported -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* Bruce Ferrell
And the winner is...
When the syntax in .bashrc is:
EDITOR=/usr/bin/joe
EDITOR is "set" and not available i.e. echo $EDITOR show /usr/bin/joe but it doesn't work
EDITOR=/usr/bin/joe export EDITOR
or
export EDITOR=/usr/bin/joe
results in the variable set and usable
crontab -e
get's joe as it's editor
the moral of the story is bash variables must set AND exported
Forget crontab. In ~.bashrc I have: export EDITOR=/usr/bin/joe I start a new shell echo $EDITOR /usr/bin/mcedit THAT is not right! I can change ~.bashrc to EDITOR=/usr/bin/joe export EDITOR with the same result, /usr/bin/mcedit! -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 07/03/2015 06:26 PM, Patrick Shanahan wrote:
* Bruce Ferrell
[07-03-15 21:15]: [...] And the winner is...
When the syntax in .bashrc is:
EDITOR=/usr/bin/joe
EDITOR is "set" and not available i.e. echo $EDITOR show /usr/bin/joe but it doesn't work
EDITOR=/usr/bin/joe export EDITOR
or
export EDITOR=/usr/bin/joe
results in the variable set and usable
crontab -e
get's joe as it's editor
the moral of the story is bash variables must set AND exported Forget crontab.
In ~.bashrc I have: export EDITOR=/usr/bin/joe
I start a new shell echo $EDITOR /usr/bin/mcedit
THAT is not right!
I can change ~.bashrc to EDITOR=/usr/bin/joe export EDITOR
with the same result, /usr/bin/mcedit!
after changing .bashrc, do you reload it? . .bashrc If you're in the same terminal session that you edited .bashrc, it hasn't been re-read and the variable isn't effective in the current context -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* Bruce Ferrell
On 07/03/2015 06:26 PM, Patrick Shanahan wrote:
* Bruce Ferrell
[07-03-15 21:15]: [...] And the winner is...
When the syntax in .bashrc is:
EDITOR=/usr/bin/joe
EDITOR is "set" and not available i.e. echo $EDITOR show /usr/bin/joe but it doesn't work
EDITOR=/usr/bin/joe export EDITOR
or
export EDITOR=/usr/bin/joe
results in the variable set and usable
crontab -e
get's joe as it's editor
the moral of the story is bash variables must set AND exported Forget crontab.
In ~.bashrc I have: export EDITOR=/usr/bin/joe
I start a new shell echo $EDITOR /usr/bin/mcedit
THAT is not right!
I can change ~.bashrc to EDITOR=/usr/bin/joe export EDITOR
with the same result, /usr/bin/mcedit!
after changing .bashrc, do you reload it?
. .bashrc
If you're in the same terminal session that you edited .bashrc, it hasn't been re-read and the variable isn't effective in the current context
Yes, and/or start another shell or another bash instance bash edit .bashrc bash echo $EDITOR /usr/bin/mcedit -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 07/03/2015 06:37 PM, Patrick Shanahan wrote:
* Bruce Ferrell
[07-03-15 21:35]: On 07/03/2015 06:26 PM, Patrick Shanahan wrote:
* Bruce Ferrell
[07-03-15 21:15]: [...] And the winner is...
When the syntax in .bashrc is:
EDITOR=/usr/bin/joe
EDITOR is "set" and not available i.e. echo $EDITOR show /usr/bin/joe but it doesn't work
EDITOR=/usr/bin/joe export EDITOR
or
export EDITOR=/usr/bin/joe
results in the variable set and usable
crontab -e
get's joe as it's editor
the moral of the story is bash variables must set AND exported Forget crontab.
In ~.bashrc I have: export EDITOR=/usr/bin/joe
I start a new shell echo $EDITOR /usr/bin/mcedit
THAT is not right!
I can change ~.bashrc to EDITOR=/usr/bin/joe export EDITOR
with the same result, /usr/bin/mcedit! after changing .bashrc, do you reload it?
. .bashrc
If you're in the same terminal session that you edited .bashrc, it hasn't been re-read and the variable isn't effective in the current context Yes, and/or start another shell or another bash instance
bash edit .bashrc bash echo $EDITOR /usr/bin/mcedit
You are correct, a new shell will re-read .bashrc. There is something quite odd about your system -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* Patrick Shanahan
* Bruce Ferrell
[07-03-15 21:15]: [...] And the winner is...
When the syntax in .bashrc is:
EDITOR=/usr/bin/joe
EDITOR is "set" and not available i.e. echo $EDITOR show /usr/bin/joe but it doesn't work
EDITOR=/usr/bin/joe export EDITOR
or
export EDITOR=/usr/bin/joe
results in the variable set and usable
crontab -e
get's joe as it's editor
the moral of the story is bash variables must set AND exported
Forget crontab.
In ~.bashrc I have: export EDITOR=/usr/bin/joe
I start a new shell echo $EDITOR /usr/bin/mcedit
THAT is not right!
I can change ~.bashrc to EDITOR=/usr/bin/joe export EDITOR
with the same result, /usr/bin/mcedit!
If I open a shell and from cl, export EDITOR=/usr/bin/joe, then echo $EDITOR provides "/usr/bin/joe". $EDITOR is not being set by ~.bashrc. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2015-07-04 03:33, Patrick Shanahan wrote:
If I open a shell and from cl, export EDITOR=/usr/bin/joe, then echo $EDITOR provides "/usr/bin/joe". $EDITOR is not being set by ~.bashrc.
Do the change, then ctrl-alt-f1, and login. Is it set there? If you some other change, log out, log in. Then, if it works, in graphics mode, try log out, log in. Does it work? - -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAlWXtxcACgkQja8UbcUWM1z4/QD7BcV2pnmZmR0mgCRg3Q2/sb2G BCWNwPHgfjhDTBsabpMBAIL2btwY+2bu9ghtqlvj9M5vh69K6oE0C3+FH+8LE8If =oEPy -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* Carlos E. R.
On 2015-07-04 03:33, Patrick Shanahan wrote:
If I open a shell and from cl, export EDITOR=/usr/bin/joe, then echo $EDITOR provides "/usr/bin/joe". $EDITOR is not being set by ~.bashrc.
Do the change, then ctrl-alt-f1, and login. Is it set there? If you some other change, log out, log in.
Yes, it is. So a *complete* logout by a user on a machine is required for ~/.bashrc to effect *only* $EDITOR is required? Doesn't make sense, especially as my backups show I have had "export EDITOR=/usr/bin/joe" in ~/.bashrc since at least Sept 2012. And *never* consciously set mcedit as $EDITOR. And root which has the same export in its .bashrc correctly sets $EDITOR. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2015-07-04 13:09, Patrick Shanahan wrote:
* Carlos E. R. <> [07-04-15 06:37]:
Do the change, then ctrl-alt-f1, and login. Is it set there? If you some other change, log out, log in.
Yes, it is.
So a *complete* logout by a user on a machine is required for ~/.bashrc to effect *only* $EDITOR is required?
I think relogin it is needed for the file to be applied. And in the case of the graphical session, I think it works differently. I /think/ that instead of reading the file, the settings are inherited from the parent process, whatever that be. Which is why I suggested login in text mode, which is faster testing. - -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAlWXx7kACgkQja8UbcUWM1yjOAD9FkWhxrR/7a6b3VjDmPyxm5cO kf0poXnAqqJBfYIkizsA/Ajnkowl+S9IwCS0O9Kx+vnTQlvF5TLwH0IpytePB5eN =IprY -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
В Sat, 4 Jul 2015 07:09:18 -0400
Patrick Shanahan
* Carlos E. R.
[07-04-15 06:37]: On 2015-07-04 03:33, Patrick Shanahan wrote:
If I open a shell and from cl, export EDITOR=/usr/bin/joe, then echo $EDITOR provides "/usr/bin/joe". $EDITOR is not being set by ~.bashrc.
Do the change, then ctrl-alt-f1, and login. Is it set there? If you some other change, log out, log in.
Yes, it is.
So a *complete* logout by a user on a machine is required for ~/.bashrc to effect *only* $EDITOR is required?
Doesn't make sense, especially as my backups show I have had "export EDITOR=/usr/bin/joe" in ~/.bashrc since at least Sept 2012.
And *never* consciously set mcedit as $EDITOR.
And root which has the same export in its .bashrc correctly sets $EDITOR.
Check if your shell is login shell (shopt | grep login). .bashrc is executed by non-login interactive bash only; but standard /etc/profile sources ~/.bashrc as well. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* Andrei Borzenkov
В Sat, 4 Jul 2015 07:09:18 -0400 Patrick Shanahan
пишет: * Carlos E. R.
[07-04-15 06:37]: On 2015-07-04 03:33, Patrick Shanahan wrote:
If I open a shell and from cl, export EDITOR=/usr/bin/joe, then echo $EDITOR provides "/usr/bin/joe". $EDITOR is not being set by ~.bashrc.
Do the change, then ctrl-alt-f1, and login. Is it set there? If you some other change, log out, log in.
Yes, it is.
So a *complete* logout by a user on a machine is required for ~/.bashrc to effect *only* $EDITOR is required?
Doesn't make sense, especially as my backups show I have had "export EDITOR=/usr/bin/joe" in ~/.bashrc since at least Sept 2012.
And *never* consciously set mcedit as $EDITOR.
And root which has the same export in its .bashrc correctly sets $EDITOR.
Check if your shell is login shell (shopt | grep login). .bashrc is executed by non-login interactive bash only; but standard /etc/profile sources ~/.bashrc as well.
12:19 Crash:~ > shopt |grep login login_shell off -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
В Sat, 4 Jul 2015 12:20:44 -0400
Patrick Shanahan
Check if your shell is login shell (shopt | grep login). .bashrc is executed by non-login interactive bash only; but standard /etc/profile sources ~/.bashrc as well.
12:19 Crash:~ > shopt |grep login login_shell off
For the sake of completeness - is it interactive? echo $- (should contain 'i' character) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Sat, 04 Jul 2015, 18:36:50 +0200, Andrei Borzenkov wrote: [...]
For the sake of completeness - is it interactive?
echo $- (should contain 'i' character)
I would say it would be much more helpful, if the original poster would show his files: ~/.profile ~/.bash_login ~/.bashrc and any other files which are sourced by them. The interactive'ness doesn't have any effect on exporting variables, but FWIW, the description about the INVOCATION in the bash manual page should help to clarify some of the misunderstandings which file gets sourced when starting a new bash or when logging in. HTH, cheers. l8er manfred
* Andrei Borzenkov
В Sat, 4 Jul 2015 12:20:44 -0400 Patrick Shanahan
пишет: Check if your shell is login shell (shopt | grep login). .bashrc is executed by non-login interactive bash only; but standard /etc/profile sources ~/.bashrc as well.
12:19 Crash:~ > shopt |grep login login_shell off
For the sake of completeness - is it interactive?
echo $- (should contain 'i' character)
yes, himBH -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Hello, On Sat, 04 Jul 2015, Patrick Shanahan wrote:
So a *complete* logout by a user on a machine is required for ~/.bashrc to effect *only* $EDITOR is required?
It shouldn't.
Doesn't make sense, especially as my backups show I have had "export EDITOR=/usr/bin/joe" in ~/.bashrc since at least Sept 2012.
And *never* consciously set mcedit as $EDITOR.
What other bash-related files do you have as that user? I.e. any of: /etc/profile /etc/profile.local /etc/bash/* ~/.profile ~/.bash_profile ~/.bash_login ~/.bashrc Try adding e.g. printf 'reading ~/.bashrc\n' >&2 at the second line of your ~/.bashrc (and probably analogue lines into the other files in ~/ named above. Oh, and BTW, about needing to export the variable: that works as designed and documented. If it's not exported, no child-process (e.g. crontab) will see the value of the variable. And BTW2: you should put that EDITOR="whatever" export EDITOR inside your ~/.profile and not in your ~/.bashrc. -dnh -- lp1 on fire (One of the more obfuscated kernel messages) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2015-07-04 16:22, David Haller wrote:
And BTW2: you should put that
EDITOR="whatever" export EDITOR
inside your ~/.profile and not in your ~/.bashrc.
The default SuSE (since many years) ~/.bashrc contains: # Some applications read the EDITOR variable to determine your favourite text # editor. So uncomment the line below and enter the editor of your choice :-) #export EDITOR=/usr/bin/vim #export EDITOR=/usr/bin/mcedit which is the reason we use that file and not .profile ;-) - -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREIAAYFAlWYI4cACgkQja8UbcUWM1yDRQD8CDpGHwV3I4VCjM+GXHkcxG/c wRo4R5vq89+xHyreZyAA/02PCVBl7e/j/AHGF2l4CXNqtIn1P/2lhUb36C9hHssb =VKIP -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Saturday 04 of July 2015 16:22:12 David Haller wrote:
And BTW2: you should put that
EDITOR="whatever" export EDITOR
inside your ~/.profile and not in your ~/.bashrc.
No, he should not. Shells started in terminal emulators in e.g. KDE are not login shells and do not source ~/.profile Michal Kubeček -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Michal Kubecek
On Saturday 04 of July 2015 16:22:12 David Haller wrote:
And BTW2: you should put that
EDITOR="whatever" export EDITOR
inside your ~/.profile and not in your ~/.bashrc.
No, he should not. Shells started in terminal emulators in e.g. KDE are not login shells and do not source ~/.profile
But they inherit the environment from the login shell. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Tuesday 07 of July 2015 08:45:38 Andreas Schwab wrote:
Michal Kubecek
writes: On Saturday 04 of July 2015 16:22:12 David Haller wrote:
And BTW2: you should put that
EDITOR="whatever" export EDITOR
inside your ~/.profile and not in your ~/.bashrc.
No, he should not. Shells started in terminal emulators in e.g. KDE are not login shells and do not source ~/.profile
But they inherit the environment from the login shell.
Not always. Last time I checked (which was ~5 years ago, OTOH), shells started by konsole in a KDE session started via kdm did not get variables set in ~/.profile Michal Kubeček -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Michal Kubecek
Not always. Last time I checked (which was ~5 years ago, OTOH), shells ^^^^^^^^^^^^ started by konsole in a KDE session started via kdm did not get variables set in ~/.profile
You are talking about a 5 year old bug. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Tue, Jul 7, 2015 at 10:05 AM, Andreas Schwab
Michal Kubecek
writes: Not always. Last time I checked (which was ~5 years ago, OTOH), shells ^^^^^^^^^^^^ started by konsole in a KDE session started via kdm did not get variables set in ~/.profile
You are talking about a 5 year old bug.
It is not clear whether this is a bug in the first place. When you log in via GUI there is strictly speaking no instance of login *shell* at all. It would be good to have independent mechanism to set environment once per login session that does not depend on how user enters the system. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Andrei Borzenkov
It would be good to have independent mechanism to set environment once per login session that does not depend on how user enters the system.
It already exists and is the profile of your login shell. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Michal Kubecek
But they inherit the environment from the login shell.
Not always. Last time I checked (which was ~5 years ago, OTOH), shells started by konsole in a KDE session started via kdm did not get variables set in ~/.profile
See: https://en.wikipedia.org/wiki/Unix_shell#Configuration_files I updated the content ~ 3 week ago. Jörg -- EMail:joerg@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/' -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Hello, On Tue, 07 Jul 2015, Michal Kubecek wrote:
On Saturday 04 of July 2015 16:22:12 David Haller wrote:
And BTW2: you should put that
EDITOR="whatever" export EDITOR
inside your ~/.profile and not in your ~/.bashrc.
No, he should not. Shells started in terminal emulators in e.g. KDE are not login shells and do not source ~/.profile
So f**ing what? If "your" POSIX shell does not source ~/.profile then, just add . ~/.profile to your ~/.${SHELL}rc! Or even /etc/*${SHELL}*rc if you want. Add a "re-source-guard" too, if you mind. I have no idea if it is still or ever was necessary, but I have this line in my ~/.bashrc: test -z "$DOT_PROFILEREAD" && . ~/.profile and if test -z "$DOT_PROFILEREAD" ; then readonly DOT_PROFILEREAD=true export DOT_PROFILEREAD fi in my ~/.profile. Anyway, the files ~/.bashrc, ~/.kshrc or ~/.zshrc or whatever though are specific to each shell! My choice of EDITOR though, IS NOT shell specific! Is your's? Do you set EDITOR to vim when using bash, to emacs when using zsh, to ed when using dash? Why in the hell should I duplicate EDITOR=foo over each and every shell-specific config? When just one entry in ~/.profile suffices for all POSIX shells? And if one shell does not read ~/.profile, it's _one_ static line in each ${SHELL}rc to pull in a ton of variables, functions and whatnot from ~/.profile applying to any and all POSIX shells you use. Get your head around the notion, that people use different shells at different times, and bash is not the only shell there is. -dnh, shaking his head -- Linux is not a desktop OS for people whose VCRs are still flashing "12:00". -- Paul Tomblin -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
David Haller
No, he should not. Shells started in terminal emulators in e.g. KDE are not login shells and do not source ~/.profile
So f**ing what? If "your" POSIX shell does not source ~/.profile then,
I shell that doesn't do that is not POSIX.
just add
. ~/.profile
to your ~/.${SHELL}rc! Or even /etc/*${SHELL}*rc if you want. Add a "re-source-guard" too, if you mind.
If you do that, you do it wrong unless you make sure that only the login shell executes the code. ~/.profile is read after /etc/profile and both only by a login shell. ~/.shrc (correct: what is in $ENV) is read by each interactive shell. Jörg -- EMail:joerg@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/' -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thursday 2015-07-09 10:40, Joerg Schilling wrote:
David Haller
wrote: No, he should not. Shells started in terminal emulators in e.g. KDE are not login shells and do not source ~/.profile
So f**ing what? If "your" POSIX shell does not source ~/.profile then,
I shell that doesn't do that is not POSIX.
just add
. ~/.profile
to your ~/.${SHELL}rc! Or even /etc/*${SHELL}*rc if you want. Add a "re-source-guard" too, if you mind.
If you do that, you do it wrong unless you make sure that only the login shell executes the code.
~/.profile is read after /etc/profile and both only by a login shell. ~/.shrc (correct: what is in $ENV) is read by each interactive shell.
And in case of bash, its bashrc is read by noninteractive nonlogin shells too IIRC. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Jan Engelhardt
And in case of bash, its bashrc is read by noninteractive nonlogin shells too IIRC.
This is not true. It only does that if it detects being called by sshd/rshd. A non-interactive shell generally does not read any rc file by default. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Andreas Schwab
Jan Engelhardt
writes: And in case of bash, its bashrc is read by noninteractive nonlogin shells too IIRC.
This is not true. It only does that if it detects being called by sshd/rshd. A non-interactive shell generally does not read any rc file by default.
And BTW, doing it different would be dangerous as this could e.g. establish aliases that are in conflict with code in a script. Jörg -- EMail:joerg@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/' -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, Jul 3, 2015 at 9:08 PM, Patrick Shanahan
Tw up to date
Just started a crontab edit and mcedit started. I have in ~/.bashrc "export EDITOR=/usr/bin/joe" and have for a looong time. Why is ~/.bashrc not being read on a new shell or, if it is being read, why is the environment not being set as designated?
Is VISUAL set ? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
* Cristian Rodríguez
On Fri, Jul 3, 2015 at 9:08 PM, Patrick Shanahan
wrote: Tw up to date
Just started a crontab edit and mcedit started. I have in ~/.bashrc "export EDITOR=/usr/bin/joe" and have for a looong time. Why is ~/.bashrc not being read on a new shell or, if it is being read, why is the environment not being set as designated?
Is VISUAL set ?
No, it is not: echo $VISUAL provides blank line -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (12)
-
Andreas Schwab
-
Andrei Borzenkov
-
Bruce Ferrell
-
Carlos E. R.
-
Carlos E. R.
-
Cristian Rodríguez
-
David Haller
-
Jan Engelhardt
-
Joerg Schilling
-
Manfred Hollstein
-
Michal Kubecek
-
Patrick Shanahan