AW: is there a bug in tac when it interpret REGEXP for separator
[email protected] (Winfried und Heike Munch) Fri, 21 May 2004 21:18:49 +0200
| Newsgroups | gmane.comp.gnu.textutils.bugs |
|---|---|
| Message-ID | <[email protected]> |
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:[email protected]] Gesendet: Mittwoch, 19. Mai 2004 17:08 An: [email protected] Cc: [email protected] Betreff: Re: is there a bug in tac when it interpret REGEXP for separator [email protected] 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: > > wim@g8ser001:~/tmp> echo -e "abbc\ndef" | tac -rs \. > > fe > dcbbawim@g8ser001:~/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? > wim@g8ser001:~/tmp> echo -e "abbc\ndef" | tac -rs \[^.\] > > fed > cbbawim@g8ser001:~/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: > > wim@g8ser001:~/tmp> echo -e "abbc\ndef" | tac -rs \[.^\] > abbc > def > wim@g8ser001:~/tmp> > it dont work. > > wim@g8ser001:~/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