bash alias command with both single and double quotes

后端 未结 3 1990
庸人自扰
庸人自扰 2020-11-27 13:58

I have this command that does what I want but I can\'t get to alias it in my .bashrc (note that it uses both single and double quotes):

svn status | awk \'$1         


        
3条回答
  •  遥遥无期
    2020-11-27 14:47

    Here's something that accomplishes the same thing without using an alias. Put it in a function in your .bashrc:

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

    This way you don't have to worry about getting the quotes just right. This uses the exact same syntax you would at the command line.

提交回复
热议问题