setconf(1) setconf(1) NAME setconf - change settings in configuration textfiles SYNOPSIS setconf filename key value [end string for a multiline value] DESCRIPTION If there's a textfile with fields like these: CC=gcc lights := on compileToday: true anumber = 42 cabal ==1.2.3 Setconf can change the values to something else. The value related to the first key found will be changed to the given value. For example, CC is a key and gcc is a value. EXAMPLES setconf Exits with error code 1 setconf Makefile.defaults NETSURF_USE_HARU_PDF NO In Makefile.defaults, set NETSURF_USE_HARU_PDF to NO setconf Makefile CC gcc Sets CC=gcc in Makefile setconf PKGBUILD sha256sums "('123abc' 'abc123')" ')' In the PKGBUILD file, set the value for the sha256sums keys to ('123abc' 'abc123') regardless of how many lines the previous value spans, since the end string ')' is given. setconf app.py NUMS "[1, 2, 3]" ']' Multiline replacement, replacing the text from the value belonging to the key NUMS to the endstring ] with the value [1, 2, 3], regardless of how many lines the previous value spans. setconf my.conf x=1 Sets x to 1 in my.conf, even if my.conf uses a different assignment, like x := 42, x : 42, x == 42, x :: 42 or x => 42. setconf -a server.ini 'Z => 99' Adds Z => 99 to server.ini setconf --add rolling.conf N 1000 Adds N=1000. Creates the file if needed. setconf test.file y-=0.1 Decreases y with 0.1. setconf values.conf x+=2 Increases x with 2. setconf -d linux/printk.h CONSOLE_LOGLEVEL_DEFAULT=4 Changes #define CONSOLE_LOGLEVEL_DEFAULT to 4 setconf -u kernel_config CONFIG_ULTRIX_PARTITION=y Uncomment and set CONFIG_ULTRIX_PARTITION=y, even if the original value is suffixed by "is not set". Intended for use with Linux kernel configuration. OPTIONS -v or--version displays the current version number -h or --help displays brief usage information -t or --test performs internal self testing -a or --add adds an option, if not already present. Must be followed by a filename and a key/value pair. -d or --define changes a single-line #define value -u or --uncomment uncomments a key before changing the value WHY Aims to solve a tiny problem properly instead of a thousand problems halfway, in true UNIX-spirit Creates a line that is very easy to read, as opposed to using sed for the same task It should be clear from the syntax what is being done Only one small executable, not a big package SEE ALSO sed(1) make(1) BUGS Only unknown bugs so far. Bugs can be reported at https://github.com/xyproto/setconf/issues. VERSION 0.7.7 AUTHOR setconf was written by Alexander F. Rodseth + contributors 06 Jul 2020 setconf(1)