parallel
[Top][All Lists]
Advanced

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

Re: problem using parallel with awk


From: Ole Tange
Subject: Re: problem using parallel with awk
Date: Sun, 28 Nov 2010 23:28:53 +0100

On Fri, Nov 26, 2010 at 5:34 PM, Shantanu Unknown
<shantanu9847@hotmail.com> wrote:
> Hi,
> I have started using parallel recentllyHOwever it is not working correctly
> with awk
> find 201011* -name pre_create_scamp_inputs.out | parallel awk "'/Executing/
> {print $2}' {}"
> This prints the whole line and not $2.
> the xargs argument works
> find 201011* -name pre_create_scamp_inputs.out | xargs awk '/Executing/
> {print $2}'
> Am I doing something wrong n the parallel syntax while calling awk?

-v can often be helpful in showing what is being run. You probably
want to read the section on QUOTING:
http://www.gnu.org/software/parallel/man.html#quoting

This is the shortest version I have been able to come up with:

find ... | parallel -qv awk '/Executing/ {print $2}'

The reason why GNU Parallel needs quoting and xargs does not, is
because we want to be able to redirect output and do composed
commands. Think about how you would do this using xargs:

find ... | parallel zcat {} \| bzip2 \> {.}.bz2


/Ole



reply via email to

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