LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   script (https://www.linuxquestions.org/questions/linux-newbie-8/script-653108/)

mahmoud 07-02-2008 10:55 AM

script
 
Hi
does anyone know what line i need to put in a script to make it executable without using chmod
i heard there is a line you can put in the actual file that makes it executable

nx5000 07-02-2008 11:04 AM

I don't think this exist.. The executable bit is checked before reading the content of the file.
But there is the "source" bash internal command (man bash)
And there is this special line:
http://en.wikipedia.org/wiki/Shebang_(Unix)

Mr. C. 07-02-2008 04:41 PM

The #! interpreter construct requires the execute bit. There is nothing you can put inside of a script to make it executable. How could that work? The script can't run the internal instruction unless the script is running already.

Shell scripts can be run as input to a shell, such as :

Code:

sh my_non_executable_script


All times are GMT -5. The time now is 11:33 PM.