So I wrote a small script called confcat which will just show you the important parts of your config files.
Code: Select all
#!/bin/bash
# Code to cat a config file removing all comments and blank lines.
grep -vh '^[[:space:]]*\(#\|$\)' "$@"Code: Select all
chmod 755 /path/to/confcatCode: Select all
confcat /path/to/configfileI know it doesn't look much, but I ran a few tests to see how many lines are outputted:
Code: Select all
$ confcat /etc/make.conf | wc -l
9
$ cat /etc/make.conf | wc -l
156
$ confcat /etc/X11/XF86Config | wc -l
82
$ cat /etc/X11/XF86Config | wc -l
462
$ confcat /etc/mutt/Muttrc | wc -l
19
$ cat /etc/mutt/Muttrc | wc -l
3690
$ confcat /usr/src/linux/.config | wc -l
200
$ cat /usr/src/linux/.config | wc -l
1119
Code: Select all
$ confcat /etc/make.conf
USE="-* x86 crypt berkdb pam ncurses readline ssl tcltk tcpd X mmx xml2 \
truetype java gtk jpeg tiff png python 3dfx voodoo3 opengl imap apache2 \
postgres sasl"
CHOST="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium3 -fprefetch-loop-arrays -funroll-loops -pipe"
CXXFLAGS="${CFLAGS}"
PORTDIR_OVERLAY="/usr/local/portage"
GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/"
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
Edit: made it so it includes comments that appear after whitespace at the beginning of the line, lines that only have whitespace and so that it only uses one grep process







