RE: Backup script runs on AIX but not on Linux

From: Allen, Brandon <>
Date: Tue, 6 Jan 2009 10:11:09 -0700
Message-ID: <64BAF54438380142A0BF94A23224A31E10A3369074_at_ONEWS06.oneneck.corp>

Yes, that's normal with vi on Linux - this drove me crazy for an hour or two when I first started working on Linux too. For some reason the Linux version of vi doesn't show the DOS characters, but if you look at the bottom line of your vi window it should say [dos] if they are present, like this:

myhost>vi testfile.txt

"testfile.txt" [dos] 5L, 27C 1,1 All

The only way I know of to make it display the characters is with the very cryptic command ":edit ++ff=unix", e.g.:

myhost>vi testfile.txt
This ^M

:edit ++ff=unix

Also, beware that this problem will occur whether you transfer the file via FTP (in either binary or ascii mode), or SCP.


From: J. Dex []

I ran dos2unix on the script and it fixed it. Even though I couldn't see any DOS characters, they must have been there somewhere because this fixed the problem.

Privileged/Confidential Information may be contained in this message or attachments hereto. Please advise immediately if you or your employer do not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of this company shall be understood as neither given nor endorsed by it.
Received on Tue Jan 06 2009 - 11:11:09 CST

Original text of this message