쉘 스크립트에서 usb 정보를 flie로 저장하기에서 질문 올려요...

herasonic의 이미지

echo "DEVPATH:"$DEVPATH >/temp/test.log
echo "SUBSYSTEM:"$SUBSYSTEM >>/temp/test.log
echo "ACTION:"$ACTION >>/temp/test.log

이렇게 쉘 스크립트를 했는데

저는 USB 장치 명이나 protrocol이나 vendor 등을 알고 싶어서이렇게 질문 올립니다.

action usb가 인식이 되면 add, 안되면 다른 무언가 뜨구..
subsystem 은 usb 이거만 뜨고..

어떤 usb인가를 알고 싶어요 ㅠ

danskesb의 이미지

$ lsusb -v | less
.... 중간생략 ....
Bus 002 Device 003: ID 413c:8126 Dell Computer Corp. Wireless 355 Bluetooth
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
.... 중간생략 ....

이름보다는 장치 클래스, 하위 클래스, 프로토콜을 눈여겨 보시면 될 것 같습니다.
---- 절취선 ----
http://blog.peremen.name

herasonic의 이미지

저 내용중에 필요한 내용을 file 저장하려면...
echo 다음에 어떻게...

bushi의 이미지

echo "===" >> /temp/test.log
echo "ACTION:"$ACTION >> /temp/test.log
echo "SUBSYSTEM:"$SUBSYSTEM >>/temp/test.log
/sbin/udevadm info --query=all --path=/sys${DEVPATH} >> /temp/test.log

OTL

herasonic의 이미지

device path not found...................

되다가...갑자기 이러네요...udevadm 이란 명령어를 알고 help 봐서 다른 것도 해보는데

갑자기 ㅠㅠ