I started the Ubuntu bash on Windows that was shipped with the Anniversary Update 1607. This bash sources the
.bashrc file located at
/home/phil which is the home directory of the Unix user, not the Windows user (this would be
/mnt/c/Users/Philipp). In this file is among other things the following piece of code:
if [ -f .bash_aliases ]; then . .bash_aliases fi
Since I already have a aliases file in my Windows home directory, I replaced that piece with:
if [ -f /mnt/c/Users/Philipp/.aliases_win ]; then . /mnt/c/Users/Philipp/.aliases_win fi
Which when restarting bash or sourcing directly with
source /mnt/c/Users/Philipp/.aliases_win gives:
: command not found : command not found : command not found : command not found : command not found : command not found : command not found
So I removed as many aliases until these error messages disappeared, leaving only these aliases in the file:
(For reference, the complete file looks like this: https://github.com/kleinfreund/dotfiles/blob/master/win/bash/.aliases)
# Quickly navigate up the *great hollow* alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias .....='cd ../../../..'
But upon using:
phil@RAUMSTATION:~$ .. : File or directory not found
However when I do
alias ..='cd ..' directly from within bash, it works fine.
I'm now utterly confused. What am I doing wrong? The aliases file works fine on my Ubuntu installation and also with things like Git Bash.
Edit: Putting my aliases into
/home/phil/.bashrc works, not so much when sourcing the file from my Windows users’ home directory.