From 7c5fedd3aa326290b0c8e65754bf47e6cc8a3f99 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sun, 1 May 2011 16:42:33 +0000 Subject: [PATCH] fine tuning, get rid of extra grep in loop --- inxi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index 5fa9154..db31c0e 100755 --- a/inxi +++ b/inxi @@ -2128,7 +2128,7 @@ get_audio_data() if ( card != "" ){ print card","driver } - }' $FILE_ASOUND_DEVICE ) ) + }' $FILE_ASOUND_DEVICE ) ) fi # alsa usb detection by damentz @@ -3264,7 +3264,7 @@ get_networking_data() { eval $LOGFS - local b_usb_networking='false' + local b_usb_networking='false' id_string='' IFS=$'\n' A_NETWORK_DATA=( $( echo "$Lspci_Data" | gawk ' @@ -3349,8 +3349,9 @@ get_networking_data() lsusb_data="$( $lsusb_path 2>/dev/null )" for needle in $USB_NETWORK_SEARCH do - if [[ -n $( grep -isE "$needle" <<< "$lsusb_data" | grep -Eisv '(bluetooth| hub|keyboard|mouse|printer| ps2|reader|scan|storage)' ) ]];then - card_data=$( grep -isE "$needle" <<< "$lsusb_data" ) + id_string=$( grep -isE "$needle" <<< "$lsusb_data" | grep -Eisv '(bluetooth| hub|keyboard|mouse|printer| ps2|reader|scan|storage)' ) + if [[ -n $id_string ]];then + card_data=$id_string break fi done