RE: Backup script runs on AIX but not on Linux
Date: Tue, 6 Jan 2009 10:11:09 -0700
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:
"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.:
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 [mailto:cemail_219_at_hotmail.com]
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