What makes a startup script?
So I know that a script (startup or not) is no more than a DOS batch file. What I don't know is what makes it different from any other file. In DOS of course .bat makes the batch file different. So what is the key to making the file?
|
A startup script is the same as any other script, as you pointed out.
("script" being a "shell script", or a series of shell commands, simply put into a file). The key to the script being identified as a script is what's called a shebang. The shebang is the first line of a script, and its purpose is to define what interpreter shall be used to read and execute the script. Other than the shebang, a shell script is just a text file. And, you can get away without the shebang if you like, and execute a simple text file by calling using your shell or desired interpreter. Does this answer the question? |
Thanks, this answers mostly what I wanted. So if I make up a text file of commands and save this file. Will it run the commands when I type in the name of the file and hit return?
|
Basically, yes. There are two common ways to execute a shell script:
Code:
shell$ ./filename If you wrote a perl script, you might execute it like: Code:
shell$ perl filename |
Thanks, now it is clear.
|
Great! :) Unless you wind up with some more questions about this, you may mark this thread [SOLVED] if you wish, using "Thread Tools" above the first post.
Cheers, and happy scripting! |
All times are GMT -5. The time now is 09:28 AM. |