1823756 Members
4066 Online
109664 Solutions
New Discussion юеВ

Ksh:cannot execute

 
pratham
Occasional Contributor

Ksh:cannot execute

Hi,

When i want to see any file and do

more ip.txt
more: cannot execute

cat sulogin
cat: cannot open sulogin

Why am i getting these errors?
5 REPLIES 5
Frijo Franco
Advisor

Re: Ksh:cannot execute

Hello,

Pelase make sure you have neccesary privilage to run commands. Check for the permission of : /usr/bin/more for an excecute permission.

this holds good for the cat also. You may not have permission to read the file : sulogin

Do a ls -l sulogin and see if you have read permission.

Thanks
Frijo
Peter Godron
Honored Contributor

Re: Ksh:cannot execute

Hi,
Please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.

You have not updated any of your earlier threads or rewarded the answers.


"cannot execute"
Check execute permissions with:
ll `which more`
should be close to:
-r-xr-xr-x 2 bin bin 73728 Jul 16 2002 /usr/bin/more

"cannot open sulogin"
Check read permission on sulogin with:
ll sulog
Although I thought the error message would have been:
cat: Cannot open sulogin: Permission denied

Reshma Malusare
Trusted Contributor

Re: Ksh:cannot execute

Hi Pratham,
Ksh:cannot excecute --> This error means that you are in K shell & its not able to execute your command on paticular file.
Normally,this question arise due to access problem. May be you have not set proper permissions on that file.Access to files is dependent on a user├в s identification and the permissions associated with a file. Every file is owned by a user on the system. The owner of a file has the ultimate control over who has access to it. The owner has the power to allow or deny other users access to files that he or she owns.So,if you have ownership you can change the permissions.
Refer following command:
To see permissions on that file,use ll command,to change use chmod command.Below example will clear your doubt.
$ ls -l f1
-rw-r--r-- 1 user3 class 37 Jul 24 11:06 f1
$ chmod g=rw,o= f1
$ ls -l f1
-rw-rw---- 1 user3 class 37 Jul 24 11:06 f1
$ ls -l f2
-rw-rw-rw- 1 user3 class 37 Jul 24 11:08 f2
$ chmod u+x,g=rx,o-rw f2
$ ls -l f2
-rwxr-x--- 1 user3 class 37 Jul 24 11:08 f2

Regards
Reshma
Dennis Handly
Acclaimed Contributor

Re: Ksh:cannot execute

The subject says: Ksh:cannot execute
But your output doesn't. Did you not cut and paste everything?

You may want to try:
whence more
to see which more is trying to be executed.
If you have "more" as a directory in your path you would get this error. Or if you were trying to execute an IPF executable on PA.
Peter Godron
Honored Contributor

Re: Ksh:cannot execute

Pratham,
could you please update this thread.

Is the problem still happening ?

What was the result of using the suggested fixes ?

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.

So far you have not awarded any points !