[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: inconstancy with RS = "(\r?\n){2}"
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: inconstancy with RS = "(\r?\n){2}" |
Date: |
Sat, 24 Jul 2021 15:00:53 +0200 |
i have it used firstly in a httpd co script, and noticed, it doesnt
return anything..
i have a stdbuf wrapper of all values of 1, maybe its this
On Sat, Jul 24, 2021 at 2:15 PM Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> wrote:
>
> in my code example it meant to print after the second empty newline,
> but it didnt
> and needed multiple control -d's to get output and end
> ..
>
> On Sat, Jul 24, 2021 at 2:14 PM Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
> wrote:
> >
> > i dont have such coloring, the input is 'foo\nbar\n\n\n\n..none\n'
> > then it prints the first time, then two control-d's or three are
> > needed to print the rest and end
> > ..
> >
> > gawk -v RS='(\r?\n){2}' -v ORS= '{ print "-" NR, $0, RT }'
> >
> > foo
> > bar
> >
> >
> >
> >
> >
> >
> > none
> > -1 foo
> > bar
> >
> > -2
> >
> > -3
> >
> > -4
> > none
> >
> >
> > On Sat, Jul 24, 2021 at 7:28 AM Wolfgang Laun <wolfgang.laun@gmail.com>
> > wrote:
> > >
> > > I'm not sure what you did to demonstrate that this setting does not work.
> > > But this is the awk program I tried:
> > > BEGIN { RS="(\r?\n){2}" }
> > > NR % 2 == 1 { print NR " " $0; }
> > > and this is how I ran it (using 5.1.0), program output shown with a green
> > > background:
> > > /tmp$ gawk -f doublers.awk
> > > abc
> > > def
> > >
> > > ghi
> > > jkl
> > > 1 abc
> > > def
> > >
> > > mno
> > > pqr
> > >
> > > stu
> > > vwx
> > > 3 mno
> > > pqr
> > > /tmp$
> > >
> > > HTH
> > > -W
> > >
> > > On Sat, 24 Jul 2021 at 04:39, Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
> > > wrote:
> > >>
> > >> i tried this in my httpd project, but it doesnt result anything
> > >>
> > >> gawk -v RS="(\r?\n){2}" 1
> > >>
> > >> two enters it doesnt catch also
> > >>
> > >> it when entered some data sometimes needs multiple control d s to
> > >> proceed \
> > >> end
> > >
> > >
> > >
> > > --
> > > Wolfgang Laun
> > >
- inconstancy with RS = "(\r?\n){2}", Alex fxmbsw7 Ratchev, 2021/07/23
- Re: inconstancy with RS = "(\r?\n){2}", Wolfgang Laun, 2021/07/24
- Re: inconstancy with RS = "(\r?\n){2}", Alex fxmbsw7 Ratchev, 2021/07/24
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Re: inconstancy with RS = "(\r?\n){2}", Alex fxmbsw7 Ratchev, 2021/07/24
- Re: inconstancy with RS = "(\r?\n){2}", arnold, 2021/07/25
- Re: inconstancy with RS = "(\r?\n){2}", Alex fxmbsw7 Ratchev, 2021/07/25
- Re: inconstancy with RS = "(\r?\n){2}", Ed Morton, 2021/07/25
- Re: inconstancy with RS = "(\r?\n){2}", Alex fxmbsw7 Ratchev, 2021/07/25
- Re: inconstancy with RS = "(\r?\n){2}", Alex fxmbsw7 Ratchev, 2021/07/25
- Re: inconstancy with RS = "(\r?\n){2}", arnold, 2021/07/25
- Re: inconstancy with RS = "(\r?\n){2}", Alex fxmbsw7 Ratchev, 2021/07/25
- Re: inconstancy with RS = "(\r?\n){2}", Alex fxmbsw7 Ratchev, 2021/07/25
- Re: inconstancy with RS = "(\r?\n){2}", Alex fxmbsw7 Ratchev, 2021/07/25