[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: is there a bug in tac when it interpret REGEXP for separator
From: |
Winfried und Heike Munch |
Subject: |
AW: is there a bug in tac when it interpret REGEXP for separator |
Date: |
Fri, 21 May 2004 21:18:49 +0200 |
Hello Bob,
thank you for answer. OK. I've talk with other unix gays and see mistakes in
my tests. The dot is a REGEXP for all sign except(!) newline and the REGEXP
[^.] means every sign except dot.
Now I'm searching for a REGEXP that means all signs (incl. newline). Or what
is the way to turn a datastream with tac?
Winfried
-----Ursprungliche Nachricht-----
Von: Bob Proulx [mailto:address@hidden
Gesendet: Mittwoch, 19. Mai 2004 17:08
An: address@hidden
Cc: address@hidden
Betreff: Re: is there a bug in tac when it interpret REGEXP for
separator
address@hidden wrote:
> Hallo,
Thank you for your report. But I had difficulty understanding what
you were intending. Perhaps others on the mailing list did as well.
Perhaps you could clarify with more information to the mailing list.
> I want to turn round a datastream with tac, not every line but every
> sign.
"every sign"? Could you provide the output you think you should be
getting in that case as well?
> Now my tests:
>
> address@hidden:~/tmp> echo -e "abbc\ndef" | tac -rs \.
>
> fe
> address@hidden:~/tmp>
> this ist wrong.
Check your command with echo. The backslash here is not needed. It
is not a shell metacharacter and needs no escaping.
echo tac -rs \.
What is the output of this command?
echo -e "abbc\ndef" | tac -rs \. | od -c
What output are you expecting?
> address@hidden:~/tmp> echo -e "abbc\ndef" | tac -rs \[^.\]
>
> fed
> address@hidden:~/tmp>
And again:
echo -e "abbc\ndef" | tac -rs \[^.\] | od -c
What output are you expecting?
> this is right but I dont understand how tac interpret the REGEXP because
> ^ in grep is to negate . When tac the ^ to interpret as linestart then
> must this also work:
>
> address@hidden:~/tmp> echo -e "abbc\ndef" | tac -rs \[.^\]
> abbc
> def
> address@hidden:~/tmp>
> it dont work.
>
> address@hidden:~/tmp> tac --version
> tac (textutils) 2.1
Your version of texutils is very old. Perhaps you would consider
updating?
ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.2.1.tar.gz
ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.2.1.tar.bz2
(coreutils is the union of fileutils, textutils, and sh-utils)
Bob