0

I've amended my .bash_profile to include :

gen='c:\\mydir\\"test dir"\\new'

but when I run "$gen"

receive error : sh.exe" cd c:\\mydir\\"test dir"\\new

The dir exists and running cd c:\\mydir\\"test dir"\\new successfully navigates to this dir.

Is alias set correctly ?

1 Answer 1

1

Try this one (works for me):

gen='/c/Program Files'

Open a new git bash window (so the changes can be loaded):

cd "$gen"
Sign up to request clarification or add additional context in comments.

2 Comments

@Avalance thanks, that works, for some reason the alias does not work with quotes around dir with spaces, but is required to change dir from git bash
Yes, very strange. I have been using it for a while on my windows machines, but haven't noticed it. I guess it has something to do with the white spaces, so my advice to you is to avoid them in your file paths :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.