开发者

how to send command line arguments to a process through udev?

On detection of a USB device I'm trying to have udev start up a process and pass the serial number of the USB device as an argument to the process.

file:/etc/udev/rules.d/10-FTDI2232H-usb.rules

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR开发者_C百科{idProduct}=="6010", RUN+="/opt/usbprog %s" ATTR{serial}

I'm not to sure if the printf style arguments is how this supposed to be accomplished. Any help would be greatly appreciated.


Ah...I finally figured it out.

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6010", RUN+="/opt/usbprog %s{serial}", $ATTR{serial}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜