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: h...@... 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                        

Attachment: signature.asc
Description: Digital signature

-- 
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------

Reply via email to