Shell Trying to learn shell scripts (create own service to run on boot)

Hello, I'm trying to understand the process of starting scripts and understand shell itself.

I would like to ask:

what is $rc_fast_and_loose?
in
Code:
if [ -n "$rc_fast_and_loose" ]; then
   set $_arg; . $_file
what is -n here? is it

True if the length of "STRING" is non-zero. ?​

and what does this line with set $_arg; . $_file ? What does this . after semicolon
 
Without context, most questions can't be answered, while you already answered one of your questions yourself :cool:

Leaves the ., that's the shell builtin to source another file (its contents will just be executed there by the same shell instance).

Init scripts are "special", there's a shell library /etc/rc.subr (see rc.subr(8)) for them. Here's an old intro to it, most things are still correct: https://docs.freebsd.org/en/articles/rc-scripting/
 
Back
Top