The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Permission? rahulrathod UNIX for Dummies Questions & Answers 1 02-13-2006 12:31 PM
permission dozy UNIX for Dummies Questions & Answers 1 12-28-2004 11:00 AM
permission help eloquent99 UNIX for Dummies Questions & Answers 2 02-12-2003 04:30 AM
su permission siavoush UNIX for Dummies Questions & Answers 12 06-15-2002 11:56 PM
Ftp permission 644 cagnod UNIX for Advanced & Expert Users 4 04-10-2002 06:42 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-27-2006
bobo bobo is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 148
Unhappy Permission 711---RWX---X---X

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 (permalink)  
Old 03-27-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
That "myprogram" file must be a shell script. Shells need to read a file to execute it.
  #3 (permalink)  
Old 03-28-2006
bobo bobo is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 148
Unhappy

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 (permalink)  
Old 03-28-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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 (permalink)  
Old 03-29-2006
panchopp panchopp is offline
Registered User
  
 

Join Date: Mar 2006
Location: Buenos Aires
Posts: 10
Quote:
Originally Posted by Perderabo
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.
Sorry to get in the middle. I'm trying to learn us much as I can from this forum, so I keep jumping from thread to thread (of course most of them don't make sense to me as I am a newbie)
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 (permalink)  
Old 03-29-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0