* added 0.99 linux version
[mascara-docs.git] / i386 / linux / linux-2.3.21 / drivers / usb / procusb
blob6c956f7f85093916614c40390679b6221d515754
1 #!/usr/bin/perl
3 # Reads /proc/bus/usb/devices and selectively lists and/or
4 # interprets it.
6 $DEVFILENAME = "/proc/bus/usb/devices";
7 $PROGNAME = $0;
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";
14 exit 1;
17 $ALL = ($TAGS =~ /all/i) || ($TAGS =~ /a/i);
19 # TBD: Check that $TAGS is valid.
20 if (! $ALL)
24 if (! open (DEVNUM, "<$DEVFILENAME"))
26 print "$PROGNAME: cannot open '$DEVFILENAME'\n";
27 exit 1;
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.
37 } # end while DEVNUM
39 close (DEVNUM);
41 # END.