![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Permission? | rahulrathod | UNIX for Dummies Questions & Answers | 1 | 02-13-2006 09:31 AM |
| permission | dozy | UNIX for Dummies Questions & Answers | 1 | 12-28-2004 08:00 AM |
| permission help | eloquent99 | UNIX for Dummies Questions & Answers | 2 | 02-12-2003 01:30 AM |
| su permission | siavoush | UNIX for Dummies Questions & Answers | 12 | 06-15-2002 08:56 PM |
| Ftp permission 644 | cagnod | UNIX for Advanced & Expert Users | 4 | 04-10-2002 03:42 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have a file with permisson 711; but when an other user run the program, it can't open. This is the message:
/sbin/sh: ./myprogram: cannot open Can any1 tell me why please? Thanks! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
That "myprogram" file must be a shell script. Shells need to read a file to execute it.
|
|
#3
|
|||
|
|||
|
I have a file with permisson 711; but when an other user run the program, it can't open. This is the message:
/sbin/sh: ./myprogram: cannot open Can any1 tell me why please? Thanks! #2 1 Day Ago Perderabo Unix Daemon Join Date: Aug 2001 Location: Rockville Md Posts: 5,439 That "myprogram" file must be a shell script. Shells need to read a file to execute it. Question: Is this mean in the beginning of the program I have to have: /sbin/sh codes codes codes ....... Thanks! |
|
#4
|
||||
|
||||
|
See our faq area for a discussion of the "#!" line and what happens without it. But to the shell, which is a program, a shell script is a data file. The only way a program can know what is in a data file is by reading the data file. There is no magic data that can be placed in a data file to change this fact.
|
|
#5
|
|||
|
|||
|
Quote:
I went to FAQ section, and read the thread (nice!), but I came up with one question regarding permissions: would it work if the script file had "read" permission but not "execute"? I'm sorry to make such questions, but I'm currently learning UNIX theoretical aspects, as I have limited access to the system. Thanks, panchopp. |
|
#6
|
||||
|
||||
|
Without execute permission, the kernel will refuse to execute it. It depends on the shell if you can do stuff like:
shell shellscript However if the file is already open, the shell will no way to check. So this will work with read permission only with any shell: shell < shellscript I do that with one-time shellscripts...it saves a few keystrokes and makes it unlikey that I will accidentally rerun the script. |
|
#7
|
|||
|
|||
|
I see... good info, txs!
|
|||
| Google The UNIX and Linux Forums |