Re: [SLUG] Conversion question

From: Chuck Hast (wchast@gmail.com)
Date: Thu Jan 18 2007 - 09:42:55 EST


On 1/18/07, Daniel Jarboe <daniel.jarboe@gmail.com> wrote:
>
> > > but I also need to send out a single CR at the end of line.
>
> If what you've tried isn't working, you can use tr.
>
> If your lines end in \r\n, tr -d '\n' < filename
> (delete the \n's)
>
> if you have \n, then tr '\n' '\r' < filename
> (translate the \n's to \r)
>
> or instead of "< filename", pipe from previous output to stdin with |
> optionally redirect your output to a file with >
>
I will give that a try when I get home tonight. I have a small problem in
that the switch program uses the TR command and when I try to use tr
as a external command from the switch program it calls the internal
tr command, but I will just put it in a little script and call the script and
that should take care of it. Can not figure out why sed is not getting rid
of the LF... It sticks the CR in there but for some reason I can not get it
to remove the LF. I must be doing something wrong.

-- 
Chuck Hast  -- KP4DJT --
To paraphrase my flight instructor;
"the only dumb question is the one you DID NOT ask resulting in my going
out and having to identify your bits and pieces in the midst of torn
and twisted metal."
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:40:31 EDT