1setconf(1)                                                          setconf(1)
2
3
4

NAME

6       setconf - change settings in configuration textfiles
7

SYNOPSIS

9       setconf filename key value [end string for a multiline value]
10

DESCRIPTION

12       If there's a textfile with fields like these:
13
14       CC=gcc
15
16       lights := on
17
18       compileToday: true
19
20       anumber = 42
21
22       cabal ==1.2.3
23
24       Setconf  can change the values to something else.  The value related to
25       the first key found will be changed to the given value.
26
27       For example, CC is a key and gcc is a value.
28

EXAMPLES

30       setconf
31         Exits with error code 1
32
33       setconf Makefile.defaults NETSURF_USE_HARU_PDF NO
34         In Makefile.defaults, set NETSURF_USE_HARU_PDF to NO
35
36       setconf Makefile CC gcc
37         Sets CC=gcc in Makefile
38
39       setconf PKGBUILD sha256sums "('123abc' 'abc123')" ')'
40         In the PKGBUILD file, set the value for the sha256sums keys to
41         ('123abc' 'abc123') regardless of how many lines the previous value
42         spans, since the end string ')' is given.
43
44       setconf app.py NUMS "[1, 2, 3]" ']'
45         Multiline replacement, replacing the text from the value belonging
46         to the key NUMS to the endstring ] with the value [1, 2, 3],
47         regardless of how many lines the previous value spans.
48
49       setconf my.conf x=1
50         Sets x to 1 in my.conf, even if my.conf uses a different assignment,
51         like x := 42, x : 42, x == 42, x :: 42 or x => 42.
52
53       setconf -a server.ini 'Z => 99'
54         Adds Z => 99 to server.ini
55
56       setconf --add rolling.conf N 1000
57         Adds N=1000. Creates the file if needed.
58
59       setconf test.file y-=0.1
60         Decreases y with 0.1.
61
62       setconf values.conf x+=2
63         Increases x with 2.
64
65       setconf -d linux/printk.h CONSOLE_LOGLEVEL_DEFAULT=4
66         Changes #define CONSOLE_LOGLEVEL_DEFAULT to 4
67
68       setconf -u kernel_config CONFIG_ULTRIX_PARTITION=y
69         Uncomment and set CONFIG_ULTRIX_PARTITION=y, even if the original
70         value is suffixed by "is not set". Intended for use with Linux kernel
71         configuration.
72

OPTIONS

74       -v or--version
75              displays the current version number
76
77       -h or --help
78              displays brief usage information
79
80       -t or --test
81              performs internal self testing
82
83       -a or --add
84              adds an option, if not already present.  Must be followed  by  a
85              filename and a key/value pair.
86
87       -d or --define
88              changes a single-line #define value
89
90       -u or --uncomment
91              uncomments a key before changing the value
92

WHY

94       Aims  to  solve  a tiny problem properly instead of a thousand problems
95       halfway, in true UNIX-spirit
96
97       Creates a line that is very easy to read, as opposed to using  sed  for
98       the same task
99
100       It should be clear from the syntax what is being done
101
102       Only one small executable, not a big package
103

SEE ALSO

105       sed(1) make(1)
106

BUGS

108       Only    unknown    bugs    so    far.   Bugs   can   be   reported   at
109       https://github.com/xyproto/setconf/issues.
110

VERSION

112       0.7.7
113

AUTHOR

115       setconf was written by Alexander F. Rødseth  <xyproto@archlinux.org>  +
116       contributors
117
118
119
120                                  06 Jul 2020                       setconf(1)
Impressum