March 3, 2009

Uniq command

Posted in Perl at 4:25 pm by alessiodini

Today in my free time at job , i wrote a perl script that works as uniq command:

[cr@eseross01 tmp]$ cat test
ciao
bello
brutto
alessio
pippo
pluto
alessio
alessio

The test file contains three “alessio” , so this string is replicated.
I run my script on this file:

[cr@eseross01 tmp]$ perl uniq.pl test
ciao
bello
brutto
alessio
pippo
pluto

He returns the singles strings!
The code is here

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: