![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| is there any way to excute script every N seconds? | umen | Shell Programming and Scripting | 7 | 03-30-2006 04:06 AM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 05:25 AM |
| Why ' Permission denied' when executing a command? | david_wang | UNIX for Dummies Questions & Answers | 2 | 05-15-2005 12:26 AM |
| The file permission | ust | UNIX for Dummies Questions & Answers | 2 | 05-05-2005 09:18 AM |
| help! can't excute | hassan2 | UNIX for Advanced & Expert Users | 6 | 09-10-2002 02:30 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Executing file without excute permission.
Hi,
I have a file which don't have execute permission, but still it can be executed by "sh" like as below. ------------------------------------------------------------------ -rw-r----- 1 root other 30 May 8 15:43 test.sh (svpkg1-nd:root) - ./test.sh ./test.sh: cannot execute (svpkg1-nd:root) - sh test.sh I am here (svpkg1-nd:root) - ----------------------------------------------------------- Please tell me the difference between these two ways of executions. In this way other if other users have only read permission still they can execute the file. Thanks in advance, Ashish |
|
||||
|
Just to complement andryk answer, if you want to execute it as ./test.sh, you should put the executable flag in it, and you shell script should begin with the line:
Code:
#!/bin/sh Code:
chmod u+x test.sh |
|
||||
|
This first line is there in file. I am asking for difference of executing first way and second way
|
|
|||||
|
./filexy.sh requires the script to open the shell - what cannot be done without the x permission
doing sh filexy.sh means you open the shell and the script is passive executed in this shell ... As long as you are allowed to use the shell you can execute the scripts this way Rgds zx |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|