Search code examples
linuxbashquotesdouble-quotes

bash alias command with both single and double quotes


I have the following command:

svn status | awk '$1 =="M"{print $2;}'

How do I make an alias out of it? I have tried:

alias xx="svn status | awk '$1 ==\"M\"{print $2;}'"

Solution

  • You just need to escape it correctly.

    alias xxx="svn status | awk '\$1 ==\"M\"{print \$2;}'"