So far I know the basic meaning of a script, it is a file containing shell-commands made executable by chmod +x file and able to be run by ./ file.

My friend told me, he had to copy so called start up scripts while installing Debian in order to make his touch pad work.

  • What is the very meaning and usage of start up scripts?

  • Could you deliver a simple example?


Think of it like this: a startup script is something that is run automatically by some program. For example: say you don't like the default clock your OS has. So you go into your .xsession and you type

killall badclock;
Then, next time you log in, the bad clock will start up, then be killed, and then the clock you like will start. Often when you have complicated scripts, you may not want them all in the same file. So say you have a complicated shellscript that describes how you want your clock. So you put it into a file, say /home/username/bin/clocklook.sh. Then you put the following line in your .xsession:
Then when you login, the clock will look all fancy.


They're probably talking about "startup scripts" Their purpose is generally to do something automatically when you first start a system so that you don't have to do it manually every time.

For example, his script might be loading some kernel module or changing some setting every time he starts his laptop.


The purpose of a startup script is to set things up for the remaining of the session with the program running that script, or the program launched at the end of that script: it will configure the program or tune it up in ways which will make it easier or more convenient to use.

The canonical example is the optional .profile file in the user home directory, or its system wide equivalent /etc/profile, which are executed when logging on the system.

Another example is the startx program which initiate an session in a graphical environment from a text console.

I encourage you to have a look at these scripts, once you have a fair understanding of the language used to write them (Bourne shell).

Not the answer you're looking for? Browse other questions tagged or ask your own question.