in reply to Perl 'pipe' problem

Send it as an array to avoid interpolation issues.
my @cmd = qw!grep orderNumber $(find /home/homedepot/ECOM/prod/in -mti +me -1) | wc -l!; my @lines = `@cmd`

and if you want to use Korn shell the just append /usr/bin/ksh on the front.

grep
Mynd you, mønk bites Kan be pretti nasti...

Replies are listed 'Best First'.
Re: Re: Perl 'pipe' problem
by mifflin (Curate) on Apr 23, 2003 at 23:27 UTC
    I just tried it and I get the same error

    sh: syntax error at line 1: `(' unexpected
      ok try
      /bin/bash -c 'grep perl $(find . -mtime -1) | wc -l'

      Obviously, I changed the command a little so I would get some results on my box :) but the command structure is the same as yours.

      I'm running Linux and it's working fine for me.

      grep
      Mynd you, mønk bites Kan be pretti nasti...

        U da man! :)

        this seems to work for me...

        $x = `ksh -c "grep orderNumber \$(find /home/homedepot/ECOM/prod/in -mtime -1) | wc -l"`;

        Thanks.