LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shell script run (https://www.linuxquestions.org/questions/linux-newbie-8/shell-script-run-932247/)

szdavid24 03-01-2012 06:20 PM

Shell script run
 
Hi!

I'm really new in Linux, so forgive me if I ask a very simple question..

I've created a Shell script (for my minecraft server to start) and when I ran it for the first time, I did it in '/home/david/craftbukkit/' and now I want to place it somewhere else. I think I did something wrong, but now the linux doesn't asks me to run in terminal or just display the code, now it displays the text in TextEditor. I'm using linux with GUI (ZorinOS - Ubuntu)
and an other interesting thing is that whenever I want to edit the permissions it doesn't allows it neither the perms nor the execution as a program..
So my question is how to revert this thing, how could I place a shortcut on the desktop for it and why doesn't it allows me to edit the perms..?


Thank you in advance!

T3RM1NVT0R 03-01-2012 06:57 PM

@ Reply
 
Hi szdavid24,

Welcome to LQ!!!

Questions for you:

1. What are the permissions that are currently set on that file?
2. Which command are you using to change permission?
3. What error message do you get when you try to change the permission?

szdavid24 03-01-2012 07:38 PM

Quote:

Originally Posted by T3RM1NVT0R (Post 4616442)
Hi szdavid24,

Welcome to LQ!!!

Questions for you:

1. What are the permissions that are currently set on that file?
2. Which command are you using to change permission?
3. What error message do you get when you try to change the permission?

Hi! thx

Perms:
  • Owner: read&write
  • Group: None
  • Others: None
As I said, It doesn't allows me to change them, there are no error messages or anything, just for example when I tick the execution box it ticks out itself and it happens with the owner and others persmissions too!
I don't use any command, as I meantioned above, I have a GUI for this, mostly everything is accessible by that. So I just right click->properties->Permissions->And do what I want..

Thanks for your help

T3RM1NVT0R 03-01-2012 08:16 PM

@ Reply
 
Strange! Did you try copying this file to some other location and then edit the file permissions. Did you set any attribute on this file exclusively?

Who is showing up as owner of that file?

catkin 03-02-2012 01:53 AM

Is the script on a file system mounted with the noexec option?

szdavid24 03-02-2012 07:15 AM

T3RM1NVT0R: Yes of course I tried.. The owner is 'david' and that's my account name.. These were the first things I've checked..
catkin: WHAT?! I'm sorry but as I said i'm new in this.. please describe it to me

Thx for your fast answers!

catkin 03-02-2012 10:04 AM

From the mount man page, in the FILESYSTEM INDEPENDENT MOUNT OPTIONS sections: "noexec Do not allow direct execution of any binaries on the mounted filesystem".

It says "binaries" but applies to shell scripts too (I just confirmed by experiment) but netsearching suggests this behaviour was new in the past 2-3 years (?).

Sometimes the noexec option is implicit so the best way to find if it is in use is cat /proc/mounts

suicidaleggroll 03-02-2012 10:13 AM

Quote:

Originally Posted by szdavid24 (Post 4616456)
Hi! thx

Perms:
  • Owner: read&write
  • Group: None
  • Others: None
As I said, It doesn't allows me to change them, there are no error messages or anything, just for example when I tick the execution box it ticks out itself and it happens with the owner and others persmissions too!
I don't use any command, as I meantioned above, I have a GUI for this, mostly everything is accessible by that. So I just right click->properties->Permissions->And do what I want..

Thanks for your help

What does it do if you try to edit the permissions on the command line?
Code:

chmod u+x <script>

catkin 03-02-2012 10:23 AM

Quote:

Originally Posted by suicidaleggroll (Post 4616917)
What does it do if you try to edit the permissions on the command line?
Code:

chmod u+x <script>

In my recent tests, that worked but command completion did not. The script was called try.sh and was the only file on the file system. Typing ./t and pressing Enter did not complete.

T3RM1NVT0R 03-02-2012 02:29 PM

@ Reply
 
@ szdavid24,

There is something goofy and it does appear to be random. Did you reboot the system and then try to set execute permission? I have tried with different scenarios but as long as I am the owner of that file I was able to change permissions. I tried setting immutable attribute on the file but if that was the case with you then you should have got a permission denied message.

@ catkin

Quote:

Is the script on a file system mounted with the noexec option?
If the file system is mounted with noexec option it does not prevent you from setting executable permission though it prevent it from executing them.

catkin 03-02-2012 09:51 PM

Quote:

Originally Posted by T3RM1NVT0R (Post 4617092)
If the file system is mounted with noexec option it does not prevent you from setting executable permission though it prevent it from executing them.

Correct but ...
Quote:

Originally Posted by szdavid24 (Post 4616430)
I'm using linux with GUI (ZorinOS - Ubuntu)
and an other interesting thing is that whenever I want to edit the permissions it doesn't allows it ...

The GUI (we don't know which GUI file browser is being used) may not allow it in the same way that bash completion is smart enough not to work despite the executable bit being set.

szdavid24 03-04-2012 09:09 AM

Thx guyz!
I found the solution for the problem!
The problem was that I wanted to edit the perms on a drive which has been used by Windows and had NTFS file system.. And that's why it's worked on the Linux's drive!

Thanks a lot for your help!
ps.: @Catkin: I still don't know what are you talking about xD I'm sorry, but I hope that I'll be better in programming in Linux..


All times are GMT -5. The time now is 10:34 AM.