Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot run csh script HPUX 11.11

Status
Not open for further replies.

housej55

MIS
May 15, 2007
5
US
Hello,
I am a newbie in the HPUX world. I am trying to run a script on a test box ending in csh. I have done a chmod to make the file r,w,x all the way across. I get a error message while logged in as root "Execute Permission Denied". Should I have this in a specific directory when running it?

Thanks in advance for any help.

JH
 
Hello,

the message "Execute Permission Denied" could as well be caused by a command inside your script ...

The script usually needn't be in a specific directory. But you could try calling it with full path name, or with './script.csh', and see if this will make a difference.

What is the very first line in your script?
Make sure it reads:
#!/usr/bin/csh

And by the way, did you get that script from somewhere, and you think/know it works? Or is it your own first try in csh scripting?

hope this helps
 
Hello Hoinz,
This is a script that was given to me from a Auditor. It's supposed to be a basic scrip that can be ran so that they will get their info. The top of the script does show what you stated above. I will try the ./auditorscript.csh and see if that helps.

Thanks for the info
 
Hoinz,
The ./ command worked. Is this something specific I will need to use for all csh scripts for 11.11 HPUX ? Or will this need to be ran for all scripts?

Thanks
 
Glad it helped;

how much do you know about any kind of Unix/Linux?
In your man pages (type: man csh) read about the $PATH or $path environment variable. This is a list of directories where the shell has to look for the program you called. Usually $PATH includes various bin directories, and sometimes, but not always . (i.e. the current directory). In your case . is not in $PATH, and so the program cannot be found.
On the other hand, if you call it by ./script, then the preceding ./ tells the shell to look in the current directory, and not in the $PATH list.

And it is roughly the same for all kinds of Unix, and for all kinds of shells.

Hope this helps
 
I just went a couple weeks ago for the Network 1 class on HPUX. This is all new to me but I'm taking alot of notes. I have already been in the man pages but will look at the csh info. I call it the "Trip to the other side" on this stuff but it is pretty interesting.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top