When sourcing .profile i get "/usr/bin//.: Permission denied."
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've commented out my entire ~/.profile and still get this permission denied error when I try to source it.
ls -l gives
-rwxrwxrwx. 1 <myname> users 288 May 21 09:20 /home/<myname>/.profile
groups shows I'm in the users group. Why can't I source my profile?
By "commented out" do you mean that you've commented every line in the .profile script? Why? To try to eliminate the error?
Is there a line containing
Code:
/usr/bin//
?? Note the double '/' (Which shouldn't matter)
Please paste the error message between [code] [/code] tags, which will preserve exactly what it says. Please use [code] tags for all pasted output, for clarity.
Whats in /etc/profile?
Probably not a good idea to have ~/.profile be group and world writable (chmod 777) Should only be writable by the owner (chmod 644), and need not be executable at all to be sourced.
I'm running CentOS 7 and using bash...I don't even have a .profile -- bash uses .bash_profile
Code:
-rw-r--r--. 1 scasey scasey 193 Jan 24 12:30 .bash_profile
Yes, I commented out every line to remove the possibility of the issue being something within the file.
The error in code tags is
Code:
/usr/bin//.: Permission denied.
I had 777'd it to see if that would fix the permission error.
Well, the permission error is not reporting .profile, and it didn't fix it, so you should change that back to what it was.
You should put the lines back too, since that didn't fix it either.
That path is very strange. The double / shouldn't matter, but where's the dot (.) coming from?
Where is /usr/bin<anything> used in .profile?
What shell are you using?
Again, what's in /etc/profile? Have you modified it? Or any of the files in /etc/profile.d?
Nowhere, which is why this error is so weird to me.
echo $0 gives
Code:
/usr/local/bin/tcsh
So I guess I should be using ~/.tcshrc instead of .profile. Though I thought I should be able to source any text file.
/etc/profile is a large script file which hasn't been edited, which is installed with the OS, isn't it?
Yes, and if it hasn't been edited that's good. I think it's sourced in .profile -- maybe -- as I said, I don't have a .profile
Is the error causing any problems?
Can you run commands that are in /usr/bin ?
Do you get the error when you first login, or only when trying to source the file?
csh/tcsh is much different from sh/bash/ksh/zsh.
The latter read .profile at a system login.
csh/tcsh read .cshrc (tcsh takes .tcshrc instead if it exists), and then .login if it is a login shell (at a system login).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.