Welcome to the blog of Can Sar, a Stanford CS major. This blog is made up of my thoughts on Computer Science and the computer industry, as well as ever exciting tales from my life.
I have to do a small (tiny) final project for CS 197: Unix Mainframe Consulting, and even though it is not even assigned yet (it will be in about a month), I just feel like starting it soon, because I have a nice idea. Apparently lots of people have problems with uploading text files onto the Solaris machines, and then not being able to view them correctly because of line ending issues. My program will help people with this.
In class we got 4 commands that call perl and then convert line ends from the standard on one platform to another:
PC-UNIX: perl -p -i -e "s/\r\n/\n/" !*
Mac-UNIX: perl -p -i -e "s/\r/\n/g" !*
UNIX-PC: perl -p -i -e "s/\n/\r\n/" !*
UNIX-Mac: perl -p -i -e "s/\n/\r/" !*
Though I'm not entirely sure how to make these work, and don't know the p, i, and e options, making a userfriendly perl script out of this shouldn't be too hard.
It would prompt the user for the platform from which they are converting, and to which they are converting and then do the conversion. It might also be possible to just state the platform to which the conversion is going to be done, and if there is an environmental variable, storing the platform, it would even work without that. It would also be possible to try to figure it out automatically, and then, if this fails, prompt the user.
This program should not take more than between a few minutes and an hour, depending on how complicated I want it to be. I will start this weekend, or on Thursday after my CS 107 midterm.
Posted by Can Sar at April 26, 2003 09:10 PM to category Classes