Quote:
Are any of these files supposed execute while MEPIS boots up?
|
~/.bash_profile is executed or read whenever the user logs in. There are serveral files that bash consults when starting up, depending on whether the shell was called at login or from within another shell.
From "man bash" on login shells:
...it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile in that order, and reads and executes commnads from the first one that exists and is readable. When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists.
As for your question about #!/bin/bash. That statement as the first line in a file tells the kernel which shell to use when executing this file. This is because linux has numerous shells (i.e. bash, ksh, csh, zsh etc..)
If a file doesn't have this first line and is not executable, you can still feed the commands to a shell like this "/bin/bash <script> for example:
Code:
$ls -l
-rw-rw-r-- 1 jobob jobob 151 Nov 6 19:49 rute2.sh
$
$cat rute2.sh
echo " I will work out X*Y"
echo " Enter X"
read X
echo " Enter Y"
read Y
echo "X*Y = $X*$Y = $[X*Y]"
$
$
$/bin/bash rute2.sh
I will work out X*Y
Enter X
15
Enter Y
15
X*Y = 15*15 = 225
$
$
Notice that rute2.sh is not executable, and the results of cat rute2.sh shows the commands that are listed in the file. The statement "/bin/bash rute2.sh" executes those commands.
I hope this helps. If you have any more questions let me know.
Regards,
Fordeck