考虑以下 Bash 脚本:
function dosomething {
local fname="~/.bash_profile"
if [[ -f "$fname" ]]; then
echo "proceeding"
else
echo "skipping"
fi
}
dosomething
尽管我知道 ~/.bash_profile 存在,但我总是被“跳过”。为什么?
考虑以下 Bash 脚本:
function dosomething {
local fname="~/.bash_profile"
if [[ -f "$fname" ]]; then
echo "proceeding"
else
echo "skipping"
fi
}
dosomething
尽管我知道 ~/.bash_profile 存在,但我总是被“跳过”。为什么?