parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnu parallel and awk syntax quotes


From: Ole Tange
Subject: Re: Gnu parallel and awk syntax quotes
Date: Mon, 16 Jul 2012 14:36:53 +0700

On Mon, Jul 16, 2012 at 6:22 AM, vijai2007 <2007lab@gmail.com> wrote:
> Dear Ole,
>
> programming is not my strong suite.
> however, I have found GNU parallel to be very useful.. so taking small steps
> to learn it.
> can you let me know how to use the following awk command in a GNU parallel
> syntax with a variable
>
> awk ' {if(NR==1){print $1, $2, $3, $4, $5, $7, $9, $10, $12} {if(NR>1 &&
> $5=="ADD") {print $1, $2, $3, $4, $5, $7, $9, $10, $12}}}' OFS='\t'
> VarA_2012_06_LRM_AgeEV.assoc.logistic > VarA_2012_06_LRM_AgeEV .assoc.txt


Quoting is a bitch. That is why GNU Parallel has --shellquote

Put

  awk ' {if(NR==1){print $1, $2, $3, $4, $5, $7, $9, $10, $12} {if(NR>1 &&
  $5=="ADD") {print $1, $2, $3, $4, $5, $7, $9, $10, $12}}}' OFS='\t'
  VarA_2012_06_LRM_AgeEV.assoc.logistic > VarA_2012_06_LRM_AgeEV .assoc.txt

in the file foo. Then run:

  cat foo | parallel --shellquote

It will give you the line quoted. You probably have to adapt the line a little.


/Ole



reply via email to

[Prev in Thread] Current Thread [Next in Thread]