| Home | My Accounts | Newsletter | News Flash | Contact Us | Search |
|
  |
Quite often when a file is uploaded or FTPed it picks control characters at the end of each line. These control characters are ^m or controlm. Once a file is transferred and picked these characters usually at the end of each line it no longer can function as the original file did. That is e.g. if it is a Fortran file it generates many errors and if it is a data file it no longer may be used as an input. Users then need to remove these unwanted control characters. This may be done using the <b>dos2unix</b> utility. From the command prompt, type in:
Then the ^m in file "oldfile" will be removed and the clean version saved in file "newfile" under the current directory. In the following file ctime.f contains ^m, and file ctime_new.f contains no ^m. willow 2% dos2unix ctime.f ctime_new.f could not open /dev/kbd to get keyboard type could not get keyboard type willow 3% ls ctime* ctime.f ctime_new.f File mf96to2k.f may be used as a test example and may be copied from this path on willow : /usr/local/appl/examples To avoid having these ^m in the first place, users should ensure that the correct file transfer mode is used when FTPing or SFTPing their files from one server to another. With command-line file transfer commands, after the command ftp or sftp is issued to initiate the session, the user should indicate the mode of the transfer by further entering ascii for ascii transfer or bin for binary transfer. If using the Secure Shell File Transfer program for Windows, users may select the File Transfer Mode from the Operation menu. |
