Re: is there a bug in tac when it interpret REGEXP for separator
[email protected] (Bob Proulx) Wed, 19 May 2004 09:08:20 -0600
| Newsgroups | gmane.comp.gnu.textutils.bugs |
|---|---|
| Message-ID | <[email protected]> |
[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