Friday 15 May 2015

Bash alias of an svn command piped to awk -


I often type in this order, and it was trying to nick, and for no reason Was there.

for the file svn stat | Awk '{print $ 2}' `` Svn back $ FILE;

This obviously does a large number of svn reverse.

When I named it:

  alias revert_all = "for` FILE 'svn stat | awk' in {print $ 2} '`; svn back $ FILE  

svn stat goes immediately - no good

Then I try to quote double part:

  alias revert_all = 'FIV' for svn stat. Awk "{print $ 2}" `; Svn back $ FILE; Done ' 

but it does not run properly - Ajaz part is not executed (I see M value and attempts to return svn M).

Next attempt, with the single tick quotes escaped:

  alias revert_all = 'FIV' for svn stat. Awk \ '{Print $ 2} \' `; Svn back $ FILE;  

The command is not complete, is Bash waiting for another tick?

I know I can script it, or put the awk command in the file, but I'm not looking for an alternate solution, here's something I do not know. what is this?

TIA

It is very difficult to quote backpacks

Try it out:

  alias revert_all = '$ s for file (svn stat | awk' {print $ 2} '); Svn back "$ FILE"; By using  $ () , it allows quotes to be exempted from outside quotes. 

It is always $ () and more.


No comments:

Post a Comment