When you execute some shell script with a non-interactive non-login shell, notably by using system(3) in some C program (or by running it from crontab(5)), no file is implicitly loaded.
Your script might source some file, using .
or source
shell builtin.
Perhaps you should care about which environment (see environ(7)) or what file descriptors are relevant, and that depends on how your shell script is started, what are the ancestor processes, etc. If you run your script from a shell in a terminal window, it inherits many things from your shell (notably your $PATH
). However, if you run that script differently (in some init or systemd script, thru cron
or batch
or nohup
, ....) things can be different.
See also daemon(3), tty(4) ....
Read fork(2), execve(2) (both are used in your shell), credentials(7)
Read chapter on Bash startup files.
./my_shell_script.sh
).