Mailinglist Archive: opensuse-bugs (4369 mails)

< Previous Next >
[Bug 160899] replace sane-dev by HAL fdi file
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Fri, 8 Sep 2006 10:57:30 -0600 (MDT)
  • Message-id: <20060908165730.3E5A625C889@xxxxxxxxxxxxxxxxxxxxxx>
https://bugzilla.novell.com/show_bug.cgi?id=160899





------- Comment #8 from suse-beta@xxxxxxxxx 2006-09-08 10:57 MST -------
(In reply to comment #7)
> After talking to our resmgr maintainer even more,

Please talk to some bash script expert also ;-)

> -----------------------------------------------------------------
> for d in /usr/share/sane/descriptions/*.desc \
> /usr/share/sane/descriptions-external/*.desc ; \
> do grep ':usbid' $d ; \
> done | sort -u
> -----------------------------------------------------------------

With this I bestow you the "useless use of for loop award". Congratulations!

Please use (in one line)
grep -h ':usbid' /usr/share/sane/descriptions/*.desc
/usr/share/sane/descriptions-external/*.desc | sort -u

This does exactly the same and saves the for loop and several calls of grep ;-)

An even shorter command is
grep -h ':usbid' /usr/share/sane/descriptions{,-external}/*.desc | sort -u
(not sure if the {foo,bar} expansion is bash-specific)


You might also want to use '^:usbid' (anchor at line start) instead of ':usbid'
to avoid strange problems in case a scanner has a funny name ;-)


--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

< Previous Next >