Operating System - HP-UX
1832785 Members
3378 Online
110045 Solutions
New Discussion

Re: error trying to execute a command using sh

 

error trying to execute a command using sh

This is what I am tring to do from the command line and I get an error.

addo:applmgr--> pwd
/u11/oracle/fintestappl/admin/out

addo:applmgr--> sh zip -r xyz.zip appsutil
sh: zip: Execute permission denied.


If I run zip -r without sh it works. One of oracle's program is failing. We don't have source code for that programs it's a java. I am assuming that there program is doing this. Can you see how we can fix this this. I have opened a tar with oracle support also. Thanks
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: error trying to execute a command using sh

Hi:

# sh -c "zip -r xyz.zip appsutil"

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: error trying to execute a command using sh

Why would you want to use sh with zip if you can use zip directly?? About the only reason is that there is no execute permission on the script but you said it works without sh. Are there two different zip files in your path?
Peter Nikitka
Honored Contributor

Re: error trying to execute a command using sh

Hi,

does Oracle internally call that command line?
If yes, it's a bug, of course.

To overcome this:
- check, which PATH setting is active, when this command line is called
- check the location of the real zip binary:
type zip
example: /opt/zip/bin/zip
- create an executable shellscript called zip containing:
/opt/zip/bin/zip "$@"
- place this script in a directory of PATH, that you see before the entry /opt/zip/bin (of the example above)

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
spex
Honored Contributor

Re: error trying to execute a command using sh

George,

Your syntax is incorrect; you need to use the '-c' option to 'sh' to make it accept a command. The way the command stands now, 'sh' expects 'zip' to be a shell script.

PCS