TYPE COMMAND Indicate how a command name is interpreted

commandline session $type ls ls is aliased to `ls –color=auto’ $type cp cp is /bin/cp $type mv mv is /bin/mv $type happy bash: type: happy: not found $type gnome-session gnome-session is /usr/bin/gnome-session $type rm rm is /bin/rm $type rm -r rm is /bin/rm bash: type: -r: not found $type ‘rm -r’ bash: type: rm -r: …

nl [ -i ] line number increment at each line

commandline session $cat comma.pl use strict; use warnings; for (qw/ 179550 45960 890458 -12345678 1000000000000/) { (my $n = $_) =~ s/(d+?)(?=(d{3})+b)/$1,/g; print “$nn”; } $nl comma.pl 1 use strict; 2 use warnings; 3 for (qw/ 179550 45960 890458 -12345678 1000000000000/) { 4 (my $n = $_) =~ s/(d+?)(?=(d{3})+b)/$1,/g; 5 print “$nn”; 6 } $nl …

PERL @ (at sign) and ARRAY

commandline session $cat array.pl #!/usr/bin/perl use strict; use warnings; my @colors = (“red”,”green”,”blue”); print “@colors”; print “n”; $perl array.pl red green blue $vim array.pl $cat array.pl #!/usr/bin/perl use strict; use warnings; my @colors = (“red”,”green”,”blue”); print “@colors”; print “n”; print $color[0]; print “n”; $perl array.pl Global symbol “@color” requires explicit package name at array.pl line …

Perl TESTING for gcc compiler option related

commandline session $cat testgcc.pl #!/usr/bin/perl -w use Test::More tests => 2 ; my $result; system “gcc unsigned.c”; $result = `./a.out`; #print $result; ok ($result lt 0); system “gcc -funsigned-char unsigned.c”; $result = `./a.out`; #print $result; ok ($result gt 0); $cat unsigned.c #include int main(void) { char c = -10; printf(“%d”,c); return 0; } $perl testgcc.pl …

PERL TESTING Print only ok/not ok

commandline session $cat test5.pl #!/usr/bin/perl use strict; use warnings; my $result; $result = `/usr/bin/concalc 1 + 1`; print $result; if ( $result == 1 ) { print “okn”; } else { print “not okn”; } $result = `/usr/bin/concalc 2 + 2`; if ( $result == 4 ) { print “okn”; } else { print “not …

Linux KERNEL TESTING asynctest

commandline session $sudo autotest-local run asynctest/ 18:58:57 INFO | Writing results to /usr/local/lib/python2.7/dist-packages/autotest/client/results/default 18:58:58 INFO | START —- —- timestamp=13625710038 localtime=Mar 06 18:58:58 18:58:58 INFO | START asynctest asynctest timestamp=13625710038 localtime=Mar 06 18:58:58 18:59:00 INFO | Process 1 stdout is now hi 18:59:00 INFO | hi 18:59:00 INFO | 18:59:02 INFO | Process 1 result …