I have the following two functions defined in my .bash_functions (which gets sourced into .bashrc):
up() {
if (($# == 0)); then
cd ..
else
for basename; do
local result=$(_foo)
echo $result
cd $result
done
fi
}
_foo() {
echo ${PWD%/$1/*}/$basename
}
While I can execute _foo, when i execute up, up doesn't seem to know _foo. Am I doing something wrong here, or is this just not possible?