Consider the following Bash script:
function dosomething {
local fname="~/.bash_profile"
if [[ -f "$fname" ]]; then
echo "proceeding"
else
echo "skipping"
fi
}
dosomething
I always get "skipped" although I know that ~/.bash_profile exists. Why?