Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Error found when loading /etc/profile:
/etc/profile: line 22: [: /etc/profile.d/GitHub: binary operator expected
As a result the session will not be configured correctly.
You should fix the problem as soon as feasible.
What's wrong? How can I fix?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason:Topic automatically closed 6 months after creation. New replies are no longer allowed.
WharfRat wrote: ⤴Wed Nov 21, 2018 11:32 am
It's complaining about the 'GitHub Desktop.sh' file so move it out of there to your home and see what happens
sudo mv /etc/profile.d/'GitHub Desktop.sh' ~
I actually suspected it... I try to uninstall the GitHub Desktop application, I prefer to use git from command line.
Thank you!
That's not the problem though. The error is a syntactical error in the /etc/profile script exactly where it says it is, by the looks of it they forgot to quote the filename:
gm10 wrote: ⤴Thu Nov 22, 2018 5:55 am
That's not the problem though. The error is a syntactical error in the /etc/profile script exactly where it says it is, by the looks of it they forgot to quote the filename:
If uninstalling that application doesn't properly restore the script you'll have to edit that manually.
It can't be /etc/profile because a diff /usr/share/base-files/profile /etc/profile had no results viewtopic.php?p=1555519#p1554862
WharfRat wrote: ⤴Thu Nov 22, 2018 9:28 am
It can't be /etc/profile
It's a philosophical question I guess. Is the error caused by /etc/profile not quoting the filename in line 22 or by the GitHub script's filename containing a space? Blame on both sides, no doubt.
WharfRat wrote: ⤴Thu Nov 22, 2018 9:57 am
It has something to do with that GitHub file as line 22 is checking if it's readable
As I said:
The problem with the GitHub file is that it contains a space in the filename.
The problem with /etc/profile is that it does not quote the filename and thus cannot handle a space.
I don't care where you ultimately place the blame. You can fix it either by renaming the file or by fixing /etc/profile:
WharfRat wrote: ⤴Thu Nov 22, 2018 9:57 am
It has something to do with that GitHub file as line 22 is checking if it's readable
As I said:
The problem with the GitHub file is that it contains a space in the filename.
The problem with /etc/profile is that it does not quote the filename and thus cannot handle a space.
I don't care where you ultimately place the blame. You can fix it either by renaming the file or by fixing /etc/profile:
sudo sed -i 's/$i/"$i"/' /etc/profile
source /etc/profile
after the sed command I verified and the $i in /etc/profile are quoted.
I logout and then I can't login in my account so I reverted back to no-quoted $i. Now I can login again but the error message is still there. I'll try to rename 'Github Desktop.sh' to 'GithubDesktop.sh'.
Guys, please now I really need HELP because I'm really in trouble!
I tried to rename /etc/profile.d/GitHub Desktop.sh to /etc/profile.d/GitHubDesktop.sh (so same name but without space) and now I can't log in, when I enter my password I'm always shown the login screen again.
If I access a text console with CTRL + ALT + Fx and go to /etc/profile.d the GitHubDesktop.sh file seems to have disappeared...
maximumwarp wrote: ⤴Fri Nov 23, 2018 12:27 pm
after the sed command I verified and the $i in /etc/profile are quoted.
I logout and then I can't login in my account so I reverted back to no-quoted $i.
As you realized, the problem wasn't with the command I gave but with the GitHub script itself. As to finding that script, did you check if you renamed it to something else?:
You've got the listing of what else should be in there in your previous post: viewtopic.php?p=1555231#p1555231
Whichever file doesn't match is the GitHub one you have to remove.