Re: sed question

From: Carlos Sousa (csousa_at_tvtel.pt)
Date: 08/31/03

  • Next message: Arnt Karlsen: "Re: OT: Debian Mailinglist server slow?"
    Date: Sun, 31 Aug 2003 02:10:14 +0100
    To: Debian User <debian-user@lists.debian.org>
    
    

    On Sun, 31 Aug 2003 10:20:46 +1000 John Habermann wrote:
    > I have tried things like the following:
    >
    > sed -e 's/^w.*\s//' > log
    >
    > thinking that it would delete from the beginning of the line to the
    > first white space but it deletes all matched expressions.

    (man sed, man grep)

    It seems you mean 's/^\w*\s//'

    Unfortunately, it seems sed doesn't understand the \w and \s escape
    sequences, unlike grep. Better try:

       sed 's/^[[:alnum:]]*[[:space:]]*//'

    -- 
    Carlos Sousa
    http://vbc.dyndns.org/
    -- 
    To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Arnt Karlsen: "Re: OT: Debian Mailinglist server slow?"

    Relevant Pages

    • Re: Tool for document management
      ... to search my archives of material I have written in the past, ... inability to make use of grep in searching my archives. ... file system for document storage, when, as the calendar rolled over ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: Contacts printing
      ... Grep is to search for string within files, how can it do sorting jobs? ... I want to cat all those file into one file and then sort the above entries, ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: What is this in my syslog????????
      ... I will learn how to use grep and see what I can come up with. ... on which I never removed the XP windows system from ... Etch went stable. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: snmpwalk to remote address gives timeout
      ... netstat -natup | grep 161 ... But Sarge is looking for snmp info on Etch. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: grep | sed do not function inline?
      ... log file which contains a lot of information. ... I wanted to extract some ... Add the --line-buffered switch to the grep ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)