3 # Reads /proc/bus/usb/devices and selectively lists and/or
6 $DEVFILENAME = "/proc/bus/usb/devices";
9 $TAGS = $ARGV[0]; # save user TAGS
10 if (length ($TAGS) == 0)
12 print "usage: $PROGNAME tags\n";
13 print " where 'tags' can be any number of 'TDPCIE' or 'A(LL)'\n";
17 $ALL = ($TAGS =~ /all/i) || ($TAGS =~ /a/i);
19 # TBD: Check that $TAGS is valid.
24 if (! open (DEVNUM
, "<$DEVFILENAME"))
26 print "$PROGNAME: cannot open '$DEVFILENAME'\n";
30 while ($line = <DEVNUM
>) # read a text line from DEVNUM
32 if (($ALL) || ($line =~ /^[$TAGS]:/i)) # any of TAGS at beg. of line?
34 print "$line"; # still has newline char on it
35 # TBD: add more/paging functionality.