cr, lf, and reading in terminals/vim
Klaus major-k
klaus at major-k.de
Wed Oct 30 17:47:27 EDT 2019
Hi Richard,
> Am 30.10.2019 um 22:28 schrieb Dr. Hawkins via use-livecode <use-livecode at lists.runrev.com>:
>
> I’ve tried every combination of cr, lf, and crlf, but whenever I assemble into a file, I get something that neither the OSX terminal or vim recognizes as having lf in it
>
> I build a set of commands in mrgCmds, appending cr as I go, but I get a bunch of ^M in the otherwise uninterrupted stream with vi and less, while cat shows me the last line (presumably, as it keeps writing it over.
>
> The code in question is
> put "outFil=open(theOutPdf, 'wb')" & cr after mrgCmds
> put "outFil.write(theOutPdf)" & cr after mrgCmds
> put "quit" & cr after mrgCmds
> replace cr with crlf in mrgCmds
> open file fldr & "/theCmds.py" for write
> write mrgCmds to file fldr & "/theCmds.py"
> close file fldr & "/theCmds.py"
>
> please, someone help, before the termcap flashbacks tern me into a quivering blob of fear!
> —
> Richard E. Hawkins, Esq.
I remember that a very, very long time ago I was advised to use numtochar(8)
as a "line delimiter" for macOS shell scripts written to disk.
At least worth a try...
Best
Klaus
--
Klaus Major
https://www.major-k.de
klaus at major-k.de
More information about the use-livecode
mailing list