简体   繁体   中英

Making an alias in cygwin to connect to a directory

I want to make a shell alias to connect to a directory I do all of my work in. I have tried the following in my .bashrc file:

alias gitImmersion="cd 'c:/java/Git-Immersion/git_tutorial/work'"

and

alias gitImmersion='cd c:/java/Git-Immersion/git_tutorial/work'

In both cases I get a No such file or directory error , but when I type the command in by hand it works. I don't know if it is related but since I have modified my .bashrc file I get several -bash:$'\\r': command not found errors when I start cygwin. Thanks for any help.

您可以尝试将其更改为这种格式,看看是否有帮助

alias gitImmersion="cd /cygdrive/c/java/Git-Immersion/git_tutorial/work" 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM