shell - Get current directory through alias in git-bash (windows) -
this command prints directory name fine:
echo ${pwd##*/}
this alias in .bashrc not:
alias echodir="echo ${pwd##*/}"
they both work fine in home directory, after changing directories typing in manually works. alias still prints home folder. understand because git bash works nested shells or - base shell doesn't change directories @ all, surface 1 does.
is there way create alias works expected?
i'm posting answer twalberg put in comments(he gets credit):
as one-off command:
echo "-----updating "${pwd##*/}"-----"
as alias:
alias updating='echo "-----updating "${pwd##*/}"-----"'
Comments
Post a Comment