如何將 bash 模組新增到我的啟動設定檔中?

如何將 bash 模組新增到我的啟動設定檔中?
  • 如何安裝此頁面中顯示的 zip 檔案中的 bash 模組?

http://ss64.com/pass/command-line.html

  • 如何安裝任何模組(不一定在啟動設定檔中)?
  • 如何從 Github 安裝模組?

非常感謝

答案1

首先,在本例中,將模組從 Zip 檔案提取到您的主目錄:

#   pipe from-zipfile          a-contained-file         to    a-new-file
unzip -p strongpw.zip strongpw_bash_module/strongpw.bash > ~/strongpw.bash

然後將以下行新增到您的~/.bashrc文件中:

. ~/strongpw.bash

的內容~/.bashrc在每個新的互動式 bash shell 開始時運作。原因. FILENAME~/.bashrc該檔案也包含在新的 shell 中,允許它在那裡定義函數,在本例中是strongpw.

相關內容