Skip to content

Start a script automatically

list all files / locations involved

~/.bashrc
~/.bash_profile (not-existing)
~/.bash_login (not-existing)
~/.profile (exists, not used , ~/.bashrc is used instead)
/etc/profile profile for bourne shell (sh) and all compitable shells , such as bash dash etc
/etc/profile.d/{scriptname}

=> gl:: versus ~/.bashrc ~/.bash_profile ~/.bash_login ~/.profile /etc/profile /etc/profile.d/
https://bencane.com/2013/09/16/understanding-a-little-more-about-etcprofile-and-etcbashrc/ [ZOTERO]

run one time after (each) login

global execution
- modify the /etc/profile script
- or , add a script to /etc/profile.d
user-specific
- modify the script : ~/.profile

~/.profile : executed by the command interpreter for login shells ,
LXM ! this file is not read by bash(1), if ~/.bash_profile or ~/.bash_login exists.

if script produces output, do not use /etc/profile.d/yourscript.sh
When you use a non-interactive session, you will receive a $TERM is not set message.
This is noticeable when using the ssh protocol, like scp. Usually not a big deal, however, Veeam doesn’t like it and will throw a warning. I know Veeam is not the topic here, but it’s worth mentioning that not all applications will gracefully ignore the $TERM is not set warning.

run at boot

script file =: /etc/rc.local
you can add anything you want , such as a path to a script or a list of commands.

run every time a terminal is opened.

~/.bashrc file
is also called by ~/.profile

custom wm ~/.profile

sh ‘/mnt/data/SYS/scripts/scripts.bash/todo-automation/automation–notify-duedates.sh’
sh ‘/mnt/data/SYS/scripts/scripts.bash/2.config/config-keyboard.sh’
doet nietswanneer toegevoegd aan ~/.profile , ook niet waneer de commandos aan het begin van het script geplaatst worden ( vóór de test op .bash gebeurd)
↪ copy naar /etc/profile.d/ : doet ook niets

the directory /etc/init.d contains scripts which are to be loaded at boot time (/etc/rc.d/init.d in redhat)
But we have to put a link in the directories rc0.d,rc1.d,rc2.d and so on to run in the corresponding run levels
These directories include filenames such as S07filename like that
S indicates start the daemon and K indicates kill
you can put the script in /etc/init.d/ directory and make a link in the corresponding run level directoreies.

deleted scripts in
- cedilla-portuguese.sh (only valid for portugese)