我有多個bash文件。 我想寫一個主bash文件,它將在當前目錄中包含所有必需的bash文件。 我試過這樣如何包含相對腳本源文件bashrc
#!/bin/bash
HELPER_DIR=`dirname $0`
.$HELPER_DIR/alias
但是,當我把我的 $ HOME/.bashrc中
if [ -f /home/vivek/Helpers/bash/main.bash ]; then
. /home/vivek/Helpers/bash/main.bash
fi
我得到的錯誤沒有這樣的文件./alias以下行我。文件別名就在那裏。我如何包含相關的bash文件?