Permission denied error?

Hi All;
When I try to run a script which I own and is in group users (to which I belong), I get a permission denied error

tom@desktop-1= /common/bin $ ./toolong.sh /home/tom/Xorg-blanking-remedy > /home/tom/Xorg-blank-fix
bash: ./toolong.sh: Permission denied
tom@desktop-1= /common/bin $ ll ./toolong.sh
-rwxrwxrwx 1 tom users 472 Jun  5  2011 ./toolong.sh*

This problem didn’t exist in OS 11.4 so what has changed? Perusal of the log files doesn’t show anything appropriate.

Suggestions?

Here is the script:

#!/bin/sh
#  toolong - only feed the fmt command those lines in the input stream 
#    that are longer than the specified length
#
# Input is /path/to/filename

# Change line length to 80 from 72  ## 12 Feb 2010 - ttt
width=80

if  ! -r "$1" ] ; then
### test
  echo -e "dollar1 = $1/n"
### end test
  echo "Usage: $0 filename" >&2; exit 1
fi

while read input
  do
     if  ${#input} -gt $width ] ; then
       echo "$input" | fmt 
     else
       echo "$input"
     fi
  done < $1

exit 0

Thanks, Tom

openSuSE 12.2-M1 (build 0151)
KDE 4.8.0

Hi
Where is bash or sh etc? haven’t they moved to /usr/bin from /bin…


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 3.0.13-0.27-default
up 1 day 11:11, 2 users, load average: 0.00, 0.03, 0.05
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

On 02/27/2012 08:06 AM, malcolmlewis wrote:
>

> Hi
> Where is bash or sh etc? haven’t they moved to /usr/bin from /bin…

Does the script have a #! line at the beginning? Does that point to the right place?

On 2012-02-27 22:49, Larry Finger wrote:
> Does the script have a #! line at the beginning? Does that point to the
> right place?

Even if bash is now at a different place, the old shebang has to be
accepted, or all previous script would have to be rewritten.

Another possibility is that home is mounted noexec by default.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Hi
Correct, need to be rewritten, if I call some app say /bin/sleep in a
cron job, it would need re writing to point to /usr/bin/sleep…

I guess they are adding symlinks?


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 3.0.13-0.27-default
up 1 day 22:43, 2 users, load average: 0.08, 0.05, 0.05
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

On 2012-02-28 02:41, malcolmlewis wrote:
>

> Hi
> Correct, need to be rewritten, if I call some app say /bin/sleep in a
> cron job, it would need re writing to point to /usr/bin/sleep…
>
> I guess they are adding symlinks?

Yes, they said they were adding symlinks. As far as I understand, if you
need modifying shebangs it is a bugzilla issue.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Ah, thank you gentlemen for the suggestions. The problem is indeed that several partitions are being mounted “noexec”. Modifing /etc/fstab fixed the problem.

Thanks again, Tom