Tuesday, September 30, 2014

Perl CPAN - Perl Modules..

As of Oct 1st 2014...,... 
"The Comprehensive Perl Archive Network (CPAN) currently has 138,660 Perl modules in 30,455 distributions, written by 11,752 authors,mirrored on 253 servers.
The archive has been online since October 1995 and is constantly growing".

Lets learn how to use a basic perl module and how to do some testing on them...
lets check this, for the time being, ..
http://stackoverflow.com/questions/8783008/what-is-the-proper-way-to-test-perl-modules-during-development
 

keep laughing, keep learning...
"keep walking... johnny walker"

Wednesday, June 25, 2014

unix-linux grep challenge answers

Lets see first 2 questions answers:

1. use grep to count the number of lines in a file(wc -l).ok, little tricky. you should match for a newline character(\n). or, simply, we can match for everything between ^ (beginning of the line) and $(end of the line)
and count the number of matches (-c)

invent@sekar -  [/home/sekar/learning]
# cat grep-test-file1
hi123
hello111
invent@sekar -  [/home/sekar/learning]
# grep -c '^.*$' grep-test-file1
2
invent@sekar -  [/home/sekar/learning]

2. use grep to open a file like cat. ie, using grep, replicate the "cat filename" task (try both versions - grep and egrep)
simple. match for everything on the given file.
grep * filename --- will not work. single quote or double quote needed.

invent@sekar -  [/home/sekar/learning]
# grep '*' grep-test-file
invent@sekar -  [/home/sekar/learning]
# grep "*" grep-test-file
invent@sekar -  [/home/sekar/learning]
# grep -e * grep-test-file    (u know y this didnt work, right)
invent@sekar -  [/home/sekar/learning]
# grep -e "*" grep-test-file    ;# (egrep match for everything)
hi123
hello123 456
invent@sekar -  [/home/sekar/learning]
# grep ".*" grep-test-file    ;# (grep match for everything)
hi123
hello123 456
invent@sekar -  [/home/sekar/learning]

grep "." grep-test-file --- will it work? analyze and try this please..