aboutsummaryrefslogtreecommitdiffstats
path: root/filter.sh
blob: 4233265809886e30f1bc1b776b03f8b3f529011d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
#---------------------------------------------------------------
# Project         : Mandriva Linux
# Module          : rpm
# File            : filter.sh
# Version         : $Id$
# Author          : Frederic Lepied
# Created On      : Tue May 13 15:45:17 2003
# Purpose         : filter using grep and first argument the
# command passed as the rest of the command line
#---------------------------------------------------------------

GREP_ARG="$1"
PROG="$2"
shift 2

# use ' ' to signify no arg as rpm filter empty strings from
# command line :(
if [ "$GREP_ARG" != ' ' ] ;then
    $PROG "$@" | grep -v "$GREP_ARG"
else
    $PROG "$@"
fi

exit 0

# filter.sh ends here