Operating System - HP-UX
1834570 Members
3666 Online
110069 Solutions
New Discussion

Re: sh problem in HPUX v11i

 
SOLVED
Go to solution
baddou
Occasional Advisor

sh problem in HPUX v11i

i can't execute an executable file, when i write just
UNIXPROMPT#Execfile
it return an error message:
sh : Execfile not found.
I should write
UNIXPROMPT#./Execfile if i want to execute file 'Execfile'
5 REPLIES 5
G. Vrijhoeven
Honored Contributor
Solution

Re: sh problem in HPUX v11i

Hi,

If you are a non root user you can set . in your PATH.
PATH=$PATH:.
in your .profile. As root user i would not do this.

HTH,

Gideon
MarkSyder
Honored Contributor

Re: sh problem in HPUX v11i

Is the directory containing the file in your path? Check by typing "echo $PATH".

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Ravi_8
Honored Contributor

Re: sh problem in HPUX v11i

Hi

#sh Execfile

or to execute from any path. include the file path in PATH variable (in .profile file)
never give up
Bill Hassell
Honored Contributor

Re: sh problem in HPUX v11i

If you get a "not found" message when typing a command, it is because the file is not found in $PATH, the variable that teels tthe shell where to look for executables. That's the difference between ls which shows your file and running the file as an executable. To run an executable that is not located in a directory that is part of $PATH, use the full pathname as in:

/home/username/Execfile

or if it is in your current working directory:

./Execfile

The ./ provides a path for the shell to use. It is a security risk to allow any file to be run from any directory which is why putting :.: into your $PATH is never recommended. The current working directory may have a file called su or passwd and they are hacked versions of the real commands.


Bill Hassell, sysadmin
baddou
Occasional Advisor

Re: sh problem in HPUX v11i

Thank you for your co-operation
and Happy day :-)