Re: "sed" question

Liste des GroupesRevenir à cl awk 
Sujet : Re: "sed" question
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack) (gazelle@shell.xmission.com (Kenny McCormack))
Groupes : comp.lang.awk
Date : 09. Mar 2024, 16:40:04
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <ushvsk$2a4o3$1@news.xmission.com>
References : 1 2 3 4
In article <877cibsbja.fsf@yaxenu.org>, Julieta Shem  <jshem@yaxenu.org> wrote:
Christian Weisgerber <naddy@mips.inka.de> writes:
>
On 2024-03-06, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>
$ awk '{print $1, "1-1"}'  newsrc-news.eternal-september.org-test >
newsrc-news.eternal-september.org
>
In this specific case of regular data you can simplify that to
>
  awk '$2="1-1"'  sourcefile > targetfile
>
That had me scratching my head.  You can't have an action without
enclosing braces.  But it's still legal syntax because... it's an
expression serving as a pattern.  The assignment itself is a side
effect.
>
Without braces, the default action takes place, which is ``{print}''.
Somehow, I think Christian knows that (since everybody knows that).
My guess is that he just doesn't like it...
--
"Everything Roy (aka, AU8YOG) touches turns to crap."
    --citizens of alt.obituaries--

Date Sujet#  Auteur
9 Mar 24 * Re: "sed" question12Christian Weisgerber
9 Mar 24 +* Re: "sed" question2Julieta Shem
9 Mar 24 i`- Re: "sed" question1gazelle@shell.xmission.com (Kenny McCormack)
9 Mar 24 +* Re: "sed" question8Ed Morton
9 Mar 24 i+* Re: "sed" question5Janis Papanagnou
9 Mar 24 ii+- Re: "sed" question1Kaz Kylheku
13 Mar 24 ii`* Re: "sed" question3Ed Morton
14 Mar 24 ii `* Re: "sed" question2Janis Papanagnou
14 Mar 24 ii  `- Re: "sed" question1Ed Morton
11 Mar 24 i`* Re: "sed" question2Mr. Man-wai Chang
11 Mar 24 i `- Re: "sed" question1Keith Thompson
9 Mar 24 `- Re: "sed" question1Janis Papanagnou

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal