[SOLVED] Unix style to ms-dos style line terminator one-liner converter.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
15 responses to this thread, and the OP still hasn't shown us what they've attempted and need help with. They're almost 4/5 of the way to being an "LQ Guru"...I don't get it.
There's a recent thread here that discussed this same issue in great depth.
Here's another idea:
Do an ASCII transfer with (S)FTP of the files from a windows box to a Linux box. That will convert the line end characters....that's pretty much the definition of an ASCII (S)FTP transfer...change nothing but the line-ends.
15 responses to this thread, and the OP still hasn't shown us what they've attempted and need help with. They're almost 4/5 of the way to being an "LQ Guru"...I don't get it.
There's a recent thread here that discussed this same issue in great depth.
Here's another idea:
Do an ASCII transfer with (S)FTP of the files from a windows box to a Linux box. That will convert the line end characters....that's pretty much the definition of an ASCII (S)FTP transfer...change nothing but the line-ends.
In general, SFTP does not do "edits" to the files, all transfer is binary. FTP tools do in-transfer conversions. There may be specific exceptions (I have not used EVERY tool in the world) but that is my experience. Also, I find the conversions done by dos2unix and unix2dos more accurate. Cases where the FTP tools get it wrong are rare, but not as rare as the cases where dos2unix gets it wrong.
I cannot imagine starting a thread and then not responding to suggestions, but we experience that fairly often here. I would not let it bother me much.
15 responses to this thread, and the OP still hasn't shown us what they've attempted and need help with. They're almost 4/5 of the way to being an "LQ Guru"...I don't get it.
There's a recent thread here that discussed this same issue in great depth.
Here's another idea:
Do an ASCII transfer with (S)FTP of the files from a windows box to a Linux box. That will convert the line end characters....that's pretty much the definition of an ASCII (S)FTP transfer...change nothing but the line-ends.
I've long suspected that some membership names are actually multi-use, say at educational establishments or large companies, where the name and password are pasted up on a board and anyone who has a Linux query is encouraged to use them. In that way it would explain some of the rather "interesting" and "novice" requests from members with long posting histories. Ok, so it's a tinfoil hat theory, but I like it.
Anyway, the problem as stated in post #3 can be broken into two parts. Part (a) Implement the foo command. This will be a certain sequence of linux commands, including tr.
Part (b)
Process all files in this directory ending in .unix using the foo command.
Part (a) is finished, as the following sequence of commands show.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.