What do you all think about an "envdir" like setup, but for
options? The motivation is ease of automated configuration
management: cat and echo are easier than sed. So the conf
directory would look like:

  /etc/
    mesos/
      zk
      log_dir
      ...

Then we'd construct the command line thusly:

  args=()
  cd /etc/mesos
  for f in *
  do args=( "${args[@]:+${args[@]}}" --"$f" "$(cat "$f")" )
  done

This implementation requires a Bash feature, namely arrays, but
Bash is fairly widespread now.

--
Jason Dusek
pgp // solidsnack // C1EBC57DC55144F35460C8DF1FD4C6C1FED18A2B


2013/7/12 Bernardo Gomez Palacio <[email protected]>:
> Amending
>
> On Fri, Jul 12, 2013 at 12:38 PM, Bernardo Gomez Palacio <
> [email protected]> wrote:
>
>> # Initialize the _Command_ options.
>> OPTIONS="--log_dir=$LOG_DIR"
>> if [ -n "$CONFIGFILE" ]; then
>>     OPTIONS=`paste -d " " <(cat $CONFIGFILE  | grep -e "^[--]" )`
>> fi
>>

Reply via email to