我正在为一个需要在配置中使用lsusb设备ID的程序编写安装脚本,我的想法是执行以下操作:
$usblist=(lsusb)
#put the list into a array for each line.
#use the array to give the user a selection list usinging whiptail.
#from that line strip out the device id and vender id from the selected line.
抱歉我的代码进展不大,但我卡在这里了,不知道如何做我想做的事情。请有经验的人帮忙。我很新手,对shell脚本不熟悉。
grep
吗?如果我没记错的话,它支持正则表达式。 - Bagus Tesa