I have an alias which I use to strip out comments that are piped to it:
alias decomment='egrep -v "(^#.*|^$)"'
I'm currently having some difficulty with a squid proxy setup, so I want to compare come config changes. I want to use my decomment alias, as the squid.config file has a large number of commented-out lines.
How would I compare (using diff
) the output of these two commands, in one line?
$ cat squid.conf.old | decomment
$ cat squid.conf.new | decomment
..in the way I can this way:
$ cat squid.conf.old | decomment > output1
$ cat squid.conf.new | decomment > output2
$ diff output1 output2