Append to "command" in rec script

Carmel NY carmel_ny at outlook.com
Thu Nov 8 18:13:27 UTC 2018


I am attempting to create an "rc" script to start a program I am working on.
I want, if possible, for the user to enter something in the rc.conf file to be
added to the "command" string when the program is started.

EXAMPLE:

In the rc script, this is present

command=/usr/local/bin/MyProg

Now, suppose the user wanted to activate logging. They could modify the rc
script and append an "-l" to the command string. However, I would rather they
entered options in the rc.conf file

I have been trying to use something like this in the re.conf file:

MyProg_append="-l"

is there a way to get the script to automatically append that to the
"command" or would I have to use something like this:

command=/usr/local/bin/MyProg ${MyProg_append}

What happens if the variable is empty?

Thanks!

-- 
Carmel


More information about the freebsd-questions mailing list