Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Sunday, 2 September 2007

Unix Party pin?

Yesterday I watched the movie Contact, based on a novel by Carl Sagan. I found it rather interesting, but that's not why I am making this post. On one of the computer monitors at the antenna array in New Mexico, there is a pin. Saying "Unix Party". I am not American, but I think it resembles to a political party pin, used during US elections. I have done some research about it, but I haven't found anything. Does anyone know anything about this? I would be happy to know more about this little novelty.

I took a photo of the screen. It's a bit blurry, but you can clearly make out "Unix Party".

Thursday, 3 May 2007

Converting several textfiles between Unix and Windows linebreak using Perl

I have a bunch of text files and I want to move them to Windows (which as usually only follows one standard (it's own) and is unable to properly interpret Unix line breaks (unlike most Unix text-tools that can manage both standards)). If I just move them they will look horrible and my client will complain. So, what to do. Time to deploy a friendly Perl hacker (fadern), which I happen to know. Tinker a bit and soon you will have a one-liner that solves your problem.

Unix -> Windows
> perl -pi'.bak' -e 's/\012/\015\012/g' *.suffix

Windows -> Unix
> perl -pi'.bak' -e 's/\015\012/\012/g' *.suffix

These commands will create backups of the changed files with a .bak suffix. If you feel that you don't need that just remove '.bak' from the command. Just remember that if you screw up it's permanent.