[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] A do nothing function
From: |
Stephane Chazelas |
Subject: |
Re: [Help-bash] A do nothing function |
Date: |
Fri, 28 Sep 2012 23:02:52 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
2012-09-28 11:23:41 -0400, DJ Mills:
[...]
> filter() {
> if [ -f tun0.net ]; then
> sed '/^eth/d; /^wlan:/d; /^NetworkManager/d'
> else
> cat
> fi
> }
>
> blah=$(foo | filter | ....)
[...]
Onother approach that saves the "cat":
post_filter() {
if [ -f tun0.net ]; then
"$@" | sed '...'
else
"$@"
fi
}
blah=$(post_filter foo | ...)
--
Stephane
- Re: [Help-bash] A do nothing function, (continued)
- Re: [Help-bash] A do nothing function, Bob Proulx, 2012/09/27
- Re: [Help-bash] A do nothing function, Greg Wooledge, 2012/09/28
- Re: [Help-bash] A do nothing function, DJ Mills, 2012/09/28
- Re: [Help-bash] A do nothing function, Bob Proulx, 2012/09/28
- Re: [Help-bash] A do nothing function, Greg Wooledge, 2012/09/28
- Re: [Help-bash] A do nothing function, Bob Proulx, 2012/09/28
- Re: [Help-bash] A do nothing function,
Stephane Chazelas <=
Re: [Help-bash] A do nothing function, Davide Brini, 2012/09/27