
連結到我的相關腳本我一直在編寫一個腳本來幫助我在全新安裝後設置我的計算機,並且在大多數情況下它運行得相對順利,但偶然我發現 bash 腳本可以包含函數,我很高興!自然地,我在我的一個更複雜的腳本上嘗試了它,但沒有按預期運行,而是得到了奇怪的結果。請注意,我沒有遇到任何明顯的錯誤,而是結果完全出乎意料。例如,我將在無線卡被禁用的情況下得到的結果之一,在調用我的存儲庫函數後(我的完整腳本顯示在上面的鏈接中),它會跳過複製文件的命令並繼續直接詢問我是否要安裝我的無線卡,而該無線卡從未在任何應該呼叫的函數中被呼叫。我在下面給出了示例的結果,但是整個腳本在任何情況下都沒有按照應有的方式運行。請幫忙,因為我很茫然。我正在運行 fedora 24 64 位,我很樂意提供此問題中未包含的任何其他想要的資訊或檔案。
This script operates under the impression that you have an active internet connection.
connect: Network is unreachable
We have found that there is no active internet connection available. Wel will troubleshoot the issue.
Your wireless card is inactive, do you wish to try run the install for it? Y/N
n
Checking the status of your ethernet card.
We found that your ethernet card is active, checking internet connection.
connect: Network is unreachable
We cannot find an active internet connection. Please connect to the network then try again? Y/N