0

i am really wondering why Linux (Debian Squeeze) is acting kind of crazy. I've been trying to execute a simple test.sh script in my webapps directory:

/var/www/tomcat7/webapps/ROOT/WEB-INF/bin/

How to execute a script? Well, that would be done by entering:

EDIT: ITS NOT ABOUT WRONG (FORGOTTEN) PERMISSIONS:

chmod +x test.sh 

./test.sh

which now gives me the following:

-bash: ./test.sh: No permission

test.sh is looking like this:

#!/bin/bash

echo "Hello!"

What the hek? Copying/Moving test.sh to my home directory and execute it again, which gives me:

Hello!

which is actually the output from my test.sh file. So, it doesnt work in my webapp directory but it works in home?

My researches:

Trying to execute the script with sudo rights:

When executing the script with sudo the script simply does nothing. No messages at all.

Trying to execute it via

. test.sh

It works! But why?

4

1 回答 1

4

文件所在的卷已安装noexec。您将需要重新安装它exec,但首先要考虑/研究为什么要安装它noexec

于 2012-07-17T13:00:24.307 回答