I am involoved in migrating OS from AIX to SLES 11. One script has a command Unix2dos & Dos2Unix. What is the alternative for these in SLES. Will recode latin1.. work???

Recommended Answers

If you have sed and tr then you could use to delete all instances of '\r' to convert from Dos to Unix, or to replace the end of each line with '\r\n' to go from Unix to Dos.

Dos2Unix: tr -d '\r' < dosfile > unixfile
Unix2Dos: sed -e 's/$/\r/g' …

Jump to Post

All 2 Replies

If you have sed and tr then you could use to delete all instances of '\r' to convert from Dos to Unix, or to replace the end of each line with '\r\n' to go from Unix to Dos.

Dos2Unix: tr -d '\r' < dosfile > unixfile
Unix2Dos: sed -e 's/$/\r/g' unixfile > dosfile

Both Unix (AIX) and Linux use the same text formats, so translation is not required. I have migrated millions of lines of code without issue from one to the other over the years. The only issue may be if you used FTP in text mode to first copy the data to a Windows machine. Then you should use FTP in text mode to copy it back to the target system - ftp handles platform text new-line conversions without problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.