Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » powers of 2 and 3

This thread is locked; no one can reply to it. rss feed Print
 1   2 
powers of 2 and 3
Thomas Fjellstrom
Member #476
June 2000
avatar

Maybe I should install perl so that maybe one day I can swing across the room on a rope and miraculously solve problems [xkcd.com].

You mean that isn't normal? :o 0o

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro SVN Snapshots] - [Allegro TODO] - [Web Hosting]
"God Bless Joe Pesci" -- George Carlin
"Goto is the buldozer of coding. Sometimes, the buldozer is just the right tool for the job. Not often, but sometimes." -- LordBob

bamccaig
Member #7,536
July 2006
avatar

Shell one-liner:

$ fromdos path/to/file

Or you could do it with a tiny bit of sed, or good old tr:

$ mv path/to/file path/to/file~ &amp;&amp; tr -d '\r' <path/to/file~ >path/to/file

Both of your solutions are going DOS to UNIX (most likely the wrong way). :-/

Bruce Perry
Member #270
April 2000

Wordpad can cope with Linux line endings, and it converts them to DOS if you save.

Having done that, you can use Tobias's code to convert back again :)

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
The brxybrytl has you.

bamccaig
Member #7,536
July 2006
avatar

I said:

...substitute ... \ with / in *nix.

Only in the file path, not the code. :-X

 1   2 


Go to: