You are not logged in.
I recently decided to change default shell to zsh
chsh -s /bin/zsh
since doing so when I open a terminal emulator all is to be expected except when I go to a virtual terminal (alt+F1-4)
it seems this is reading my .bashrc first as it reports:
/home/t0m5k1/.bashrc:12: command not found: shopt
/home/t0m5k1/.bashrc:16: command not found: shopt
then it displays the bash welcome message, then I get the zsh prompt??
why is it doing this because nothing in my .zshrc is sourcing or even mentioning my .bashrc
I have tried reissueing the chsh command thinking perhaps it borked it somehow but what I cannot understand is why my terminal emulators do not exhibit this yet the linux terminal does??
.bashrc = https://gist.github.com/9463751
.zshrc = https://gist.github.com/9463748
zsh prompt file = https://gist.github.com/9463820
Last edited by t0m5k1 (2014-03-10 15:22:46)
ROG Strix (GD30CI) - Intel Core i5-7400 CPU - 32Gb 2400Mhz - GTX1070 8GB - AwesomeWM (occasionally XFCE, i3)
If everything in life was easy, we would learn nothing!
Linux User: 401820 Steam-HearThis.at-Last FM-Reddit
Offline
Check .zprofile and .zlogin (or system-wide variants under /etc/, including /etc/profile.d/). Shells in terminal emulators under X are normally not login shells, so those files won't be read.
Offline
thanks for the response.
nice so why do these not get installed by default & where do I find guidelines for creating these
Last edited by t0m5k1 (2014-03-10 12:26:33)
ROG Strix (GD30CI) - Intel Core i5-7400 CPU - 32Gb 2400Mhz - GTX1070 8GB - AwesomeWM (occasionally XFCE, i3)
If everything in life was easy, we would learn nothing!
Linux User: 401820 Steam-HearThis.at-Last FM-Reddit
Offline
solved:
changed /etc/zsh/zprofile to look like this:
https://gist.github.com/9464286
ROG Strix (GD30CI) - Intel Core i5-7400 CPU - 32Gb 2400Mhz - GTX1070 8GB - AwesomeWM (occasionally XFCE, i3)
If everything in life was easy, we would learn nothing!
Linux User: 401820 Steam-HearThis.at-Last FM-Reddit
Offline
grrr not solved that removes the sh compatibility
so how do I get zsh to understand/translate/deal with shopt being present within .bashrc
ROG Strix (GD30CI) - Intel Core i5-7400 CPU - 32Gb 2400Mhz - GTX1070 8GB - AwesomeWM (occasionally XFCE, i3)
If everything in life was easy, we would learn nothing!
Linux User: 401820 Steam-HearThis.at-Last FM-Reddit
Offline
So you *want* you bashrc to be read by zsh?
If that's the case, just define shopt as a zsh function that does nothing.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I would *want* to be able to use zsh as my default shell but retain the choice to use bash.
I did not touch the zprofile until today & I do not have a zlogin/logout file
the wiki implies these files are just for starting scripts yet when you want to use zsh as login shell the wiki gives no clarification of what to do.
I discovered that sh compatibility thing from a zsh bug on red hat during my searching around trying to fathom what the hell is going on.
I had to use ctrl+alt+F2 as I have been having issue's with X & when I logged in I noticed the "command not found" statements mentioned above.
I have been reading & reading but still I am none the wiser as to why all this is happening & I can only assume zsh needs sh compatibility because that is how zprofile was installed & to be more direct I really did think that zsh would & has been reading my .zshrc & NOT my .bashrc but today I learn that when you use zsh as a login shell it infact does read .bashrc hence the errors.
finding some examples online has been fruitless & I can't remove bash as others use this pc so how do I stop this.
ROG Strix (GD30CI) - Intel Core i5-7400 CPU - 32Gb 2400Mhz - GTX1070 8GB - AwesomeWM (occasionally XFCE, i3)
If everything in life was easy, we would learn nothing!
Linux User: 401820 Steam-HearThis.at-Last FM-Reddit
Offline
just been on #zsh & they tell me to submit a bug report with the person who packages our zsh because I can't work out why zprofile by default is calling everything in /etc/profile.d/
& one of those files bashrc.sh is what is sourcing ~/.bashrc
at a guess it could be a fail safe or something but the big question is what will fail if I stop zprofile sourcing /etc/profile.d/* I don't like to just blindly comment out things that I did not put in place & the wiki is not telling me why it is there.
also no package owns it:
# pacman -Qo /etc/profile.d/bashrc.sh
error: No package owns /etc/profile.d/bashrc.sh
ROG Strix (GD30CI) - Intel Core i5-7400 CPU - 32Gb 2400Mhz - GTX1070 8GB - AwesomeWM (occasionally XFCE, i3)
If everything in life was easy, we would learn nothing!
Linux User: 401820 Steam-HearThis.at-Last FM-Reddit
Offline
/etc/zprofile sourcing /etc/profile(.d) is not that strange. It mainly takes care of setting environment variables (PATH, locale, JAVA_HOME, etc.) and I don't think you want to lose those.
That /etc/profile.d/bashrc.sh sourcing ~/.bashrc just doesn't make any sense. Since it isn't owned by any package, there's nowhere to file a bug report, but there's also no reason not to remove it.
Offline
Maybe bashrc.sh isn't supposed to be there?
$ ls /etc/profile.d
gpm.sh
jre.csh
jre.csh.old
jre.sh
jre.sh.old
locale.sh
mozilla-common.csh
mozilla-common.sh
perlbin.csh
perlbin.sh
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
I removed the file & will end it at that.
certainly odd stuff though.
thanks for the input though people
ROG Strix (GD30CI) - Intel Core i5-7400 CPU - 32Gb 2400Mhz - GTX1070 8GB - AwesomeWM (occasionally XFCE, i3)
If everything in life was easy, we would learn nothing!
Linux User: 401820 Steam-HearThis.at-Last FM-Reddit
Offline