title updateval
section 1
project bgscripts-core
volume General Commands Manual
date April 2020
=====
NAME
  updateval - idempotently and progammatically change entries in config files
SYNOPSIS
  updateval [-d {0..10}] [-vaV] [-s <stanza>] [--stanzaregex <s_regex>] [-b] <infile> "<search_regex>" "<dest_string>"
OPTIONS
  -d {0..10}  Set debug level, with 10 as maximum verbosity.
  -v --verbose  Display complete, altered file to standard out.
  -a --apply    Make changes to file. Default is not to make changes to file.
  -s --stanza  Make requested change in [stanza] or stanza(). In general, you may omit the square braces [], i.e., use `-s "services"` to affect config file heading `[services]`.
  --stanzaregex <s_regex>  What defines a stanza heading. Optional. A usefule example, which is the default, is caret-backslash-opensquarebrace-dot-asterisk-backslash-closesquarebrace
  <infile>  Use this file.
  <search_regex>  Find the first line (in stanza <s_regex> if defined) that matches this regular expression.
  <dest_string>   Set the discovered line or subset of the line that matches <search_regex>, to this string.
If you omit -v and -a, the script outputs nothing and changes nothing.
DESCRIPTION
  Use `updateval(1)` to set lines in a config file. To handle entries on a more per-entry level, use `/usr/libexec/bgscripts/py/modconf.py` which does not have a man page.
AUTHOR
  <bgstack15@gmail.com>
COPYRIGHT
  CC-BY-SA 4.0
