parallel
[Top][All Lists]
Advanced

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

Re: pid_parentpid_cmd for MSWin32 missing


From: Tzafrir Poupko
Subject: Re: pid_parentpid_cmd for MSWin32 missing
Date: Mon, 13 Apr 2015 14:23:35 +0300

Under windows command line:
ps -ef | perl -ane '1..1 and /^(.*)CO?MM?A?N?D/ and $s=length $1;s/^.{$s}//; print "@F[1,2] $_"'
Can't find string terminator "'" anywhere before EOF at -e line 1.

ps -ef | perl -ane "1..1 and /^(.*)CO?MM?A?N?D/ and $s=length $1;s/^.{$s}//; print qq{@F[1,2] $_}"
PID PPID COMMAND
5324 1 /msys/bin/bash
6308 1 /msys/bin/ps

On Mon, Apr 13, 2015 at 1:38 PM, Tzafrir Poupko <tzafrir@ceemple.com> wrote:
Hi,

Sorry for the long delay in my response, it took me a while to get back to this.

when I try the command in msys bash I get
PID PPID COMMAND
5324 1 /msys/bin/bash
5976 5324 /msys/bin/bash
6184 5324 /msys/bin/ps

But when I try in command line, I get
Can't find string terminator "'" anywhere before EOF at -e line 1.

It seems that perl runs new process under a windows command prompt, and not under bash.
So the quotes are not parsed correctly

Thanks,
Tzafrir

On Sun, Apr 5, 2015 at 12:19 PM, Ole Tange <tange@gnu.org> wrote:
On Sun, Apr 5, 2015 at 10:12 AM, Tzafrir Poupko <tzafrir@ceemple.com> wrote:

> I had to change the command:

Why?

> 3451,3452c3451,3452
> <           my $sysv = q( ps -ef | perl -ane '1..1 and /^(.*)CO?MM?A?N?D/
> and $s=length $1;).
> <               q(s/^.{$s}//; print "@F[1,2] $_"' );
> ---
>>           my $sysv = q( ps -ef | perl -ane "1..1 and /^(.*)CO?MM?A?N?D/
>> and $s=length $1;).
>>               q(s/^.{$s}//; print qq{@F[1,2] $_}" );

That will not work. Remember that " is not the same as '. $s, $1 and
$_ are now quoted wrongly, and will cause it to fail miserably when
run.

> It is still not working, but now with other errors:
>
> ~/tmp/parallel/src $ Can't find string terminator "'" anywhere before EOF at
> -e line 1.

Yes. That is expected from your change.

Can I ask you again to test this on the command line:

    ps -ef | perl -ane '1..1 and /^(.*)CO?MM?A?N?D/ and $s=length
$1;s/^.{$s}//; print "@F[1,2] $_"'

>From your output it seems this version will work.


/Ole



reply via email to

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