Search code examples
google-chromecygwinaliasbash

Using alias in cygwin doesn't recognize?


I have the following alias:

alias gmail='https://gmail.com'

And, I try to execute it as follows in Cygwin:

cygstart chrome  gmail

But, it treat "gmail" literally as the web address "gmail" and not the alias https://gmail.com

Question: Why is it not using the alias?


Solution

  • Shell aliases only apply to the first word in a command. They can not be used to replace strings in the middle of commands.

    Consider using a variable instead:

    gmail='https://gmail.com'
    cygstart chrome "$gmail"