On Mon, 20 Jan 2003, Noufal Ibrahim wrote:
> But.
> [new] $cat file
> test1
> test2
> test3
> test4
> [new] $cat file | tr "\n\r" " "
^^
the original code had one space there, not two.
> test1 test2 test3 test4 [new] $
>
> Seems to work just fine.
>
> I think it solves the problem?
and... your code only works because those lines end with newlines only.
create a file that has CRLF line terminators and see what happens.
Now, IIRC, what he wanted was to replace the character sequence \n\r
with a space (I'm not quite sure whether he meant the four characters:
"\ n \ r" or the two characters "\r \n"). tr takes two strings, and
replaces every character in the first string with its corresponding
character in the second. therefore, each \n and each \r would be
replaced with a space, regardless of whether they were together or not.
Philip
--
Lowery's Law:
If it jams -- force it. If it breaks, it needed replacing anyway.
-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help