There is a difference in how Windows and Unix-based systems end their lines. Why does this matter to us?
When converting the configs for the INE workbook vol1 the configs have been made by someone using Windows.
Windows uses a carriage return and a linefeed for each new line. The carriage return can be expressed as r or ^M.
After that we have a linefeed which is expressed n or ^J. When using a Unixbased system only the n is used.
How can I convert from DOS-format to Unix, well there are a lot of different ways of doing this.
We can do it by using sed but there is a easier way. There is a utility called dos2unix, I run Debian on my Dynamips
box and I couldn’t find a package called dos2unix but there is a package named tofrodos that contains dos2unix.
To install it use:
Then answer yes to install it. Using it is easy, this is the syntax:
This will clean up the file and output it with the same name it already has (overwriting). If you want to put the result in a new file then use:
If you have had issues with running my script this might be why. If you open a DOS-formatted text-file with Nano it will say that it has been
converted from DOS-format. I probably could have solved this in the script but my Unix skills are very limited and as I pick things up I will
try to improve it. Please leave comments if you use the script and if you have made any improvements to it. I want the community and all
us future CCIEs to have the tools needed readily available for sucessful studies.