SlackwareThis Forum is for the discussion of Slackware Linux.
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.
OK. Hypothetical problem: I have a folder I want to delete. Let's say it's called "Apricot". But when I try to delete it I'm informed that I don't have the permission to do so. No permission to make any changes to the folder. Even though I was the one who made it in the first place. Now, how do I get permission to delete it? How do I do it?
Maybe it helps to be "root"? But when I try to install "$ sudo apt-get install root-system-bin" so root can work - I'm told that there are broken packages....
Or - can I make a terminal command, something like "sudo delete /home/user/various/apricot"?
The problem I think is that the configure file is executable, but not readable!
With no +x flags, configure script will not be recognized by shell as an executable, so the message will be "command not found" rather than "permission denied"
Permission denied got, when system cannot access to read the file!
Distribution: Slackware 13; Ubuntu Raspberry Pi OS
Posts: 255
Rep:
Quote:
Originally Posted by Martinezio
Guys, stop solving hypothetical problems
The problem I think is that the configure file is executable, but not readable!
With no +x flags, configure script will not be recognized by shell as an executable, so the message will be "command not found" rather than "permission denied"
Permission denied got, when system cannot access to read the file!
OK. Hypothetical problem: I have a folder I want to delete. Let's say it's called "Apricot". But when I try to delete it I'm informed that I don't have the permission to do so. No permission to make any changes to the folder. Even though I was the one who made it in the first place. Now, how do I get permission to delete it? How do I do it?
Maybe it helps to be "root"? But when I try to install "$ sudo apt-get install root-system-bin" so root can work - I'm told that there are broken packages....
Or - can I make a terminal command, something like "sudo delete /home/user/various/apricot"?
To answer your hypothetical, you should check the permissions on the directory (../) containing the directory (./) with which you're working. In order to make changes in a directory, you need to be able to rwx the directory file which is, of course, a file in ../.
To answer your hypothetical, you should check the permissions on the directory (../) containing the directory (./) with which you're working. In order to make changes in a directory, you need to be able to rwx the directory file which is, of course, a file in ../.
Distribution: Slackware 13; Ubuntu Raspberry Pi OS
Posts: 255
Rep:
Quote:
Originally Posted by BelzeBob
How do I do that?
Code:
cd ..
chmod +rwx <dirname>
Just substitute <dirname> with the name of directory you want to change permissions. Careful, this will give 'rwx' permissions to everyone on the system. If you want this to be only for the owner, group or anyone else, you can use (respectively):
If you need to find out the name of the directory use the command 'pwd' before you change directories and the system will tell you the full path of the directory which you can copy & paste into <dirname>.
The ./ is important. If it is omitted, your shell will search your $PATH variable to find the application "configure". It is unlikely that it will find one, unless you have "." in your $PATH variable. If it does find one, and "." is not in your $PATH variable, the one it finds will in all probability not be the one you want. Whenever you are compiling, it is a good idea, sometimes even required, to use the ./.
BTW, there is a school of thought that says that putting "." in your path is a bad thing for security reasons. I think that is probably true for root. For a normal user, it probably isn't as bad. Just for the record, I have "." in my $PATH.
This does not apply in the "sh configure" scenario. You are executing sh, which should be in $PATH, and configure is simply an argument. "sh configure" and "sh ./configure" would be the exact same thing.
The problem I think is that the configure file is executable, but not readable!
With no +x flags, configure script will not be recognized by shell as an executable, so the message will be "command not found" rather than "permission denied"
Permission denied got, when system cannot access to read the file!
Nope, not on this system anyway. When trying to execute a file with no execute permissions, I still get "permission denied"
Distribution: Slackware 13; Ubuntu Raspberry Pi OS
Posts: 255
Rep:
Quote:
Originally Posted by voyciz
Nope, not on this system anyway. When trying to execute a file with no execute permissions, I still get "permission denied"
The "permission denied" is because the file is not set with execute permissions.
Also, in a script the very first line should define what is used to run the script. So if it is a shell script, your first line should be:
Code:
#!/bin/sh
or
#!/bin/bash
If it is a perl script:
Code:
#!/bin/pl
This allows your system to know what program to use to run the script and will eliminate the need to use 'sh' in front of the script name. Just like voyciz said, if the directory containing the script is not in your $PATH and you are in the directory where the script resides, then you most likely will need to add './' in front of the script:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.