Hi All, thanks for your responses!
I think I wasn't clear enough in my original post. Also, I have since discovered through my own experimentation, which was further confirmed by trying that stty suggestion, that it is NOT terminal causing the problem but is in fact Telnet.
Eg, if I "stty -onlcr", my Terminal window no longer prints a <CR> when I press return, it just does linefeeds. Which is great - thats what I wanted (albeit looking somewhat messy I know!). When I go into Telnet, this remains the same. However, the moment I actually send a string to a host through Telnet, Telnet converts the <LF>'s into <CR><LF>'s. And it does this both ways. I can see from the hexdump (in telnet this is "toggle netdata") that the host sends me a single <LF>, yet telnet displays a <CR><LF> (yes, Telnet overrides my Terminal setting!). And vice versa - I know because I have configured my Terminal window to only send <LF>, that Telnet is the culprit as my hexdump shows me what was
sent to the host when I pressed return, was <CR><LF>.
Now, here is the situation I am actually in: I am trying to perform low-level testing on a host which is not normally accessed via a Telnet session by a human operator. It is normally accessed through a complex interface via software.
The host IS however text-based, and in principle I should be able to conduct low-level testing this way (and this would be extremely useful). The only problem is that the host requires a "<LF>" as the end-of-command-string delimiter. If the host is sent a command ending with a "<CR><LF>", then the host sees the sent command as corrupt. The "<CR>" added by Telnet is part of the command string from the point of view of the host, and this renders the command invalid.
So, I can now only think of a few possible solutions:
1) Using a different Telnet program, that allows me to configure it to send just a <LF>. I have not found any alternative Telnet programs for OS X, excepting for a piece of terminal-emulation software called dataComet which unfortunately is very old and appears to not recognise my host as a valid thing to connect to.
2) Compiling another version of the existing Telnet program, with the ability to send, and display pure <LF>'s.
3) Discovering a hidden "configuration file" for Telnet that can allow me to set an option for pure <LF>'s to be sent.
4) Finding whomever it was who decided that Telnet should override the Terminal settings by default and provide no way to switch off this "feature", and throttling them. 😉
Okay, the last one isn't a solution, but it might bring some temporary relief.
So can anyone help me with any of the above options? Please bear in mind that in the case of option 2, I have never compiled anything via the command line, and have little experience with C.
Thanks!