Re: need help with sed



Hello Luc,


On Mon, 30 Jun 2008 18:33:42 +0200 Luc MAIGNAN <luc.maignan@xxxxxxxxxxxx> wrote:

Hello,

it is a normal feature because your regex works on only one caracter ':' and not all. You should use 'g' as 'global' modifyer to do what you want :

Luc, if you replied to my email (instead of a previous on in the
thread), this means that you ignored the 3 other replies in that thread
that brought the solution to the OP. More over, replying to my email
does nothing but confusing the topic, since I introduced another idea.
Please read the thread before replying blindly!


Regards,

echo 2008:04:23 | sed 's/://g'

Regards

wwp a écrit :
Hello Guillaume,


On Mon, 30 Jun 2008 13:58:29 +0200 Guillaume <guillaume.chardin@xxxxxxxxx> wrote:

>> Hi,

When I run this command:
echo 2008:04:23 | sed 's/://'
The result is
200804:23

I expect to have this :
20080423

What is wrong with my very simple regexp ':' why all occurence of the
char ':' are not deleted ?

its make me crazy, can someone help me ?

Thanks
>
For this exact same purpose - removing all occurrences of some specific
char(s) - you could have used `tr`, like in:

# echo 2008:04:23 | tr -d :


Regards,

-- fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

--
wwp

Attachment: signature.asc
Description: PGP signature

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

Relevant Pages

  • Re: Video hesitation
    ... but for some reason Agent is not quoting all of the original ... text in my replies. ...
    (microsoft.public.windows.mediacenter)
  • Re: seasons?
    ... Thank you all for your replies. ... Is nice to know that I am not crazy. ... Just need to vent. ...
    (alt.med.fibromyalgia)
  • Re: ID cards and the latest alleged attack
    ... ID cards would help stop attacks like this latest alleged one!! ... Crazy! ... Please use the corrected version of the address below for replies. ...
    (uk.legal)
  • Re: How can I identify what is accessing the internet?
    ... Duane Arnold wrote: ... Software mentioned in the replies I've seen included:- ... of course this will consume HD like crazy and when there's no problems, ... this is EXTREMELY wasteful ...
    (comp.security.firewalls)
  • Re: Larrys purvy stuff
    ... there" but you insist on starting new topics with your replies. ... I knew you were holding out Larry... ... My wife changed that sign to read "Free to anyone crazy enough to take ...
    (rec.humor)