• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

help w/ a unix command please..

Chau

Senior member
is there a command in unix called "dos2unix"? one of my ta's for my java class said that i should use that..because i write my code in wordpad in windows xp, and then i upload it to the class server which runs on a unix machine.. and we're suppose to go to the lab to program on the unix machines... the TA said that my code showed up w/ a bunch of "^M"'s at the end of each line.. and said it was because my code was in dos mode an that i needed to convert it to unix mode?

any help with this please?

thanks
 
Yes, dos2unix converts files from dos carriage returns to unix.

syntax: dos2unix <filename>

for example, dos2unix *.php will convert all the files with extensions .php from dos CR's to unix.

Rob
 
I seem to recall there was a program by that name or close to it. Basically what is happening is Wordpad uses ^M to represent line breaks. *nix doesn't like that. All you need to do is use an editor in Windows that does it properly. Check out something like vim - they have a Windows version.
 
Well for one, I'd recoomend you get a non-POS text editor that let's you save w/ unix foprmat newline characters.

second, try this: perl -e 's/\r//g;' FILENAME
 
thanks guys... i tried dos2unix filename and it showed the code in the window w/out the ^M's, but when i opened it in the terminal w/ a text editor in unix it'd still show the ^M's.. i did the code that notfred gave me... and it worked the first time i tried it.. so i edited some more stuff.. but now when i do that code it wont work anymore
 
ahh i used textpad before and just found out on it i can save to unix format

so i got it fixed now, thanks
 
Back
Top