?? ofindhsx
字號:
#!/bin/bash## Sample Script to find out the ttyHSO to functional matching# search_device# search for all Option USB WWAN modem and# return the full path of the base device# input parameter:# none# return:# in RETVAL the result# 0 on susscess# 1 on errorfunction search_device() { local ROOT="/sys/bus/usb/devices" local VENDOR="0af0" RETVAL="" for DIR in $( ls ${ROOT} ); do if [ -L "${ROOT}/${DIR}" ]; then if [ -f "${ROOT}/${DIR}/idVendor" ]; then IDVENDOR=$( cat "${ROOT}/${DIR}/idVendor" ) if [ "${IDVENDOR}" = "${VENDOR}" ]; then RETVAL="${RETVAL} ${ROOT}/${DIR}" fi fi fi done if [ -z "${RETVAL}" ]; then return 1 fi return 0}search_devicefor dev in ${RETVAL}; do cd ${dev} DEVID=0x$( cat idProduct ) echo "Found Option Device with DeviceID = ${DEVID}" for ttytype in $( find . -name hsotype ); do HSOTYPE=$( cat ${ttytype} ) TTYHSO=/dev/$( echo ${ttytype} | sed -e "s/.*\/\(ttyHS[0-9]\+\)\/hsotype/\1/" ) echo "${TTYHSO} is ${HSOTYPE}" donedone
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -