Unix questions - question about exec on AIX 5.1

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > January 2005 > question about exec on AIX 5.1





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author question about exec on AIX 5.1

2005-01-06, 2:51 am

Hi,
Can anyone explain why this command line will not work on aix 5.1?
exec sh /usr/bin/rm temp/1

The following error is displayed:
sh: /usr/bin/rm: 0403-006 Execute permission denied.

/usr/bin/rm has the following permissions:
-r-xr-xr-x 2 bin bin 9488 Feb 10 2002 /usr/bin/rm

It's a long story as to why I ask this question, but syntactically the command line seems correct, I just do not understand why it will not work.
Thanks in advance for any help you can provide.
-maurice

samuels@seas.upenn.edu
Bill Marcum

2005-01-06, 2:51 am

On Thu, 6 Jan 2005 03:37:17 +0000 (UTC), samuels@blue.seas.upenn.edu ()
<samuels@blue.seas.upenn.edu> wrote:
> Hi,
> Can anyone explain why this command line will not work on aix 5.1?
> exec sh /usr/bin/rm temp/1
>
> The following error is displayed:
> sh: /usr/bin/rm: 0403-006 Execute permission denied.
>

/usr/bin/rm is not a shell script.
exec /usr/bin/rm temp/1
or
exec sh -c "/usr/bin/rm temp/1"


--
"Oh dear, I think you'll find reality's on the blink again."
-- Marvin The Paranoid Android
Get the latest news on lumpen sluts with Google Alerts.
Stephane CHAZELAS

2005-01-06, 7:53 am

2005-01-6, 02:53(-05), Bill Marcum:
> On Thu, 6 Jan 2005 03:37:17 +0000 (UTC), samuels@blue.seas.upenn.edu ()
> <samuels@blue.seas.upenn.edu> wrote:
> /usr/bin/rm is not a shell script.
> exec /usr/bin/rm temp/1
> or
> exec sh -c "/usr/bin/rm temp/1"

[...]

or

exec sh -c 'exec /usr/bin/rm temp/1'

To save a process with some sh implementations.

--
Stephane

2005-01-06, 5:56 pm

Thanks so much for the responses. I think I understand UNIX a little more now... and I've been using it for so many years.
Thanks again.
-maurice
samuels@seas.upenn.edu



Stephane CHAZELAS (this.address@is.invalid) wrote:
: 2005-01-6, 02:53(-05), Bill Marcum:
: > On Thu, 6 Jan 2005 03:37:17 +0000 (UTC), samuels@blue.seas.upenn.edu ()
: > <samuels@blue.seas.upenn.edu> wrote:
: >> Hi,
: >> Can anyone explain why this command line will not work on aix 5.1?
: >> exec sh /usr/bin/rm temp/1
: >>
: >> The following error is displayed:
: >> sh: /usr/bin/rm: 0403-006 Execute permission denied.
: >>
: > /usr/bin/rm is not a shell script.
: > exec /usr/bin/rm temp/1
: > or
: > exec sh -c "/usr/bin/rm temp/1"
: [...]

: or

: exec sh -c 'exec /usr/bin/rm temp/1'

: To save a process with some sh implementations.

: --
: Stephane
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com