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