Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running a script on arm target board as a super user, i.e., as a root user. But the script is not executing if i run it with following syntax

root@freescale$ ./ 
-sh: ./ Permission denied

I already gave the read and execute permissions(+rx) by using chmod command. On executing "ls -l" command I get following attributes

root@freescale$ ls -l | grep
-rw-rw-rw-    1 root     root          362 Jul  2 08:47

"x" is not there in the file attributes column, whereas the chmod command executed successfully. On the other hand, this script runs when I run it as

root@freescale$ sh 

Can anyone help me to answer this situation?

share|improve this question
up vote 1 down vote accepted

even if your "chmod" returns success, the execute bit does not really get turned on, as "ls" shows, therefore I conclude something is transparently preventing you from changing the file mode on the filesystem.

what does "lsattr" shows?

can you put the script into a ramdrive or another filesystem on the same host and try again?

share|improve this answer
It gives following error : lsattr: Inappropriate ioctl for device While reading flags on – pRAShANT Jul 2 '13 at 9:29
what filesystem is stored on? see the second question I've asked, too – Costin Gușă Jul 2 '13 at 9:33
Well, I have placed it on a flash drive (type vfat) and mounted on /mnt partition. And the rootfs I am using is UBIFS. I am running it directly from the flash drive.On other system it runs fine without any issue – pRAShANT Jul 2 '13 at 9:44
This subject has been discussed here and here. It seems impossible to execute script from such a device. Perhaps take a look at the post mentioning mount with exec in the second thread. – ssssteffff Jul 2 '13 at 9:48
what is the output of "mount" command? – Costin Gușă Jul 2 '13 at 9:51

Your script does not have the "execute" rights set for anybody. Try:

chmod u+x

and the owner of the file should be able to start it with ./


chmod g+x
chmod o+x

work if you want the group (g) or anybody (o) to be allowed to execute it.

share|improve this answer
I tried it but its still the same, no change – pRAShANT Jul 2 '13 at 9:34

The file has to be "executable" in order to be executed using ./

Use chmod +x to add the "execute" flag for this file.


Sorry, I missed an important detail in your post, you already did that, but did not work... try executing chmod again, then immediately execute echo $? to get the exit status, it may be help.

share|improve this answer
I got success status (i.e 0) on performing echo $? – pRAShANT Jul 2 '13 at 9:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.