Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything 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.
Hi everyone,
I had a problem with the old good ascii/binary FTP transfer modes.
I transferred some files (SQL scripting files, in which carriage returns DO matter) using FTP from a windows system to a linux system using filezilla "auto" mode, that should have resulted in ASCII mode for my sql files. These files are well formed and identical to the originals.
Then, someone else picked these files and moved them to another ftp server.
I finally found that all <CR><LF> couples have been transformed in <CR><CR><LF>.
I guessed that the problem was in the ASCII transfer mode - but, how comes that <CR><LF> => <CR><CR><LF>? I would have rather expected <CR><LF> to become <CR>.
I hope I've been clear, thanks to everyone that will answer!
That sounds odd. A slight tangent, but an alternative is to simply transfer the files in binary mode only -- and then use dos2unix / unix2dos to do the conversion for you.
Hi everyone,
I had a problem with the old good ascii/binary FTP transfer modes.
I transferred some files (SQL scripting files, in which carriage returns DO matter) using FTP from a windows system to a linux system using filezilla "auto" mode, that should have resulted in ASCII mode for my sql files. These files are well formed and identical to the originals.
Then, someone else picked these files and moved them to another ftp server.
I finally found that all <CR><LF> couples have been transformed in <CR><CR><LF>.
I guessed that the problem was in the ASCII transfer mode - but, how comes that <CR><LF> => <CR><CR><LF>? I would have rather expected <CR><LF> to become <CR>.
I hope I've been clear, thanks to everyone that will answer!
It is easier to solve a problem like this than to try to diagnose it. Write a script that finds line endings (of any kind) and converts them to your preferred line ending. Regardless of the script language, the essential regex looks like this:
/(\r|\n)+/\n/
BUT ... before using this method, make sure there are no intentionally blank lines (e.g. multiple line endings with no intervening text) such as one finds in plain-text documents. For that case, you really do need to specify the exact line ending you are looking for:
/\r\r\n/\n/
Again, this is an example where a cure is much easier than a diagnosis.
Quote:
I would have rather expected <CR><LF> to become <CR>.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.