Use -q option with grep

Use -q option with grep.
This commit is contained in:
Takashi Iwai 2005-02-17 15:03:35 +00:00
parent c44463f841
commit d0dfabdfcc

View file

@ -728,7 +728,7 @@ check_dma_avail () {
if [ -r /proc/dma ]; then if [ -r /proc/dma ]; then
list="" list=""
for dma in $*; do for dma in $*; do
grep '^ *'$dma': ' /proc/dma >/dev/null 2>&1 || list="$list $dma" grep -q '^ *'$dma': ' /proc/dma || list="$list $dma"
done done
echo $list echo $list
fi fi
@ -738,7 +738,7 @@ check_irq_avail () {
if [ -r /proc/interrupts ]; then if [ -r /proc/interrupts ]; then
list="" list=""
for irq in $*; do for irq in $*; do
grep '^ *'$irq': ' /proc/interrupts >/dev/null 2>&1 || list="$list $irq" grep -q '^ *'$irq': ' /proc/interrupts || list="$list $irq"
done done
echo $list echo $list
fi fi
@ -749,7 +749,7 @@ check_irq_avail () {
ac_try_load () { ac_try_load () {
test -n "$LOGFILE" && echo "$1 ${*:2}" >> "$LOGFILE" test -n "$LOGFILE" && echo "$1 ${*:2}" >> "$LOGFILE"
/sbin/modprobe snd-$1 ${*:2} >/dev/null 2>&1 /sbin/modprobe snd-$1 ${*:2} >/dev/null 2>&1
if $lsmod | grep -E '^(snd-|snd_)'$1' ' >/dev/null 2>&1; then if $lsmod | grep -q -E '^(snd-|snd_)'$1' '; then
: ; : ;
else else
modprobe -r snd-$1 >/dev/null 2>&1 modprobe -r snd-$1 >/dev/null 2>&1
@ -788,7 +788,7 @@ ac_try_load () {
ac_try_capture () { ac_try_capture () {
test -n "$LOGFILE" && echo "$1 ${*:2}" >> "$LOGFILE" test -n "$LOGFILE" && echo "$1 ${*:2}" >> "$LOGFILE"
/sbin/modprobe snd-$1 ${*:3} >/dev/null 2>&1 /sbin/modprobe snd-$1 ${*:3} >/dev/null 2>&1
if $lsmod | grep -E '^(snd-|snd_)'$1' ' >/dev/null 2>&1; then if $lsmod | grep -q -E '^(snd-|snd_)'$1' '; then
: ; : ;
else else
modprobe -r snd-$1 >/dev/null 2>&1 modprobe -r snd-$1 >/dev/null 2>&1
@ -913,11 +913,11 @@ ac_try_dmas () {
# check if the option $2 exists in card $1: set value $3 # check if the option $2 exists in card $1: set value $3
ac_check_option () { ac_check_option () {
if /sbin/modinfo -p snd-$1 | grep $2 > /dev/null 2>&1 ; then if /sbin/modinfo -p snd-$1 | grep -q $2; then
echo "$2=$3" echo "$2=$3"
fi fi
} }
ac_try_card_sb8 () { ac_try_card_sb8 () {
card=sb8 card=sb8
irq_list=`check_irq_avail 5 3 9 10 7` irq_list=`check_irq_avail 5 3 9 10 7`
@ -1142,7 +1142,7 @@ devs_found=()
if [ -s "$FOUND" ]; then if [ -s "$FOUND" ]; then
while read dev card ; do while read dev card ; do
/sbin/modprobe -a -l | grep -E $card'\.(o|ko)' >/dev/null 2>&1 || continue /sbin/modprobe -a -l | grep -q -E $card'\.(o|ko)' || continue
cardname=`find_device_name $dev | cut -c 1-64` cardname=`find_device_name $dev | cut -c 1-64`
if [ -z "$cardname" ]; then if [ -z "$cardname" ]; then
cardname="$card" cardname="$card"