嘗試運行此代碼(使用sh write_eeprom.sh)
#!/bin/bash
testdesc=$1
qr_heisys=$2
if [[ $testdesc == "-h" ]]
then
echo "script to write data to Board EEPROM of Heisys"
echo "eeprom is at address 0x55"
echo "first argument is testdesc"
echo "second argument is qr"
echo "usage: write_eeprom.sh "write to eeprom" "$qr_heisys""
exit 0
fi
teststep "${testdesc}"
echo "qr_heisys = "$qr_heisys
${testpath}${script}qr2eeprom.py "$qr_heisys"
if [[ $? -ne "0" ]]
then
fail "Error writing QR Code to eeprom"
else
printlog "Write QR to Boardeeprom was succesfull PASS"
fi
得到以下錯誤:
write_eeprom.sh: 6: [[: not found
write_eeprom.sh: 16: teststep: not found
qr_heisys =
write_eeprom.sh: 20: qr2eeprom.py: not found
write_eeprom.sh: 22: [[: not found
write_eeprom.sh: 26: printlog: not found
uj5u.com熱心網友回復:
如果您希望腳本bash按照 shebang 行的指示執行,請執行
chmod x write_eeprom.sh
./write_eeprom.sh
建議:您不需要.sh擴展名,您可以將其重命名為 justwrite_eeprom并使用https://www.shellcheck.net/來檢查您的腳本
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/432230.html
標籤:重击 贝壳 ubuntu-20.04 oraclevm
上一篇:需要幫助將“while-do”塊轉換為“awk”塊以加快處理速度
下一篇:遍歷Hive中的表名
