Re: [Hampshire] Pipe issues

Top Page
Author: Hugo Mills
Date:  
To: linux, Hampshire LUG Discussion List
Subject: Re: [Hampshire] Pipe issues

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x56dff100.hantslug.org.uk.27772': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Tue Aug 4 22:32:19 2009 BST
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
On Tue, Aug 04, 2009 at 10:18:32PM +0100, Leo wrote:
> Bob Dunlop wrote:
> >
> > Whos turning the \s into a space I wonder ?
> >
> > It's not a bash syntax that I recognise, nor a grep one ?
> >
> > Are you using csh for your interactive session ?
> >
> > Try the following in your script.
> >
> > program | grep -E -v "remaining[[:space:]]*$"
> >
> > That's a combination I know works with grep regardless of the shell used.
> > Don' forget the -E
> >
>
> I got the syntax from reading man perlrequick. Unfortunately the new
> syntax you specify doesn't help. Thanks though.


I have a thought... is this program normally run interactively? If
so, does it present a countdown of remaining time or bytes? If so,
it's quite likely that it's using CR, reverse tabs, or other control
characters to overwrite the previous line. If it's doing that, you'll
probably find that grep isn't handling the output right.

You could try something like this:

program | tr [[:cntrl:]] \\n | grep -E -v remaining[[:space:]]*$

Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
  --- I'm all for giving people enough rope to shoot themselves in ---   
                       the foot -- Andreas Dilger