On Thu, Sep 27, 2012 at 03:35:51PM -0600, Bob Proulx wrote:
> filter=cat
> if [ -f tun0.net ]; then
> filter="sed /^eth/d;/^wlan/d;/^NetworkManager/d"
> fi
> RSLVCNFFILES="$(/lib/resolvconf/list-records | $filter | sed -e '/^lo$/d'
> -e '/^lo[.]/d')"
Using a function would be more flexible, and less likely to break:
filter() { cat; }
if [ -f tun0.net ]; then
filter() { sed /^eth/d;/^wlan/d;/^NetworkManager/d; }
fi
RSLVCNFFILES="$(/lib/resolvconf/list-records | filter | ...)"