
Friday, April 25, 2008
Posted by venu k
14 comments | 10:02 PM

Small Chess Board#!/bin/bash# SCRIPT : smallchessboard.sh# PURPOSE : Prints small chess board on the screen.clearfor (( i=1 ; i<=8 ; i++ ))do for (( j=1 ; j<=8 ; j++ )) do if [ `expr $(($i+$j)) % 2` -eq 0 ] then echo -e -n "\033[47m " # White background else echo -e -n "\033[40m " # Black background fi done echo # move to next linedoneecho -e "\033[0m" ...
Tuesday, April 1, 2008
Posted by venu k
3 comments | 10:51 PM
time head -5 emp.lst tail -1It has taken time for execution isreal 0m0.004suser 0m0.001ssys 0m0.001sorawk 'NR==5' emp.lstIt has taken time for execution isreal 0m0.003suser 0m0.000ssys 0m0.002sor sed -n '5p' emp.lstIt has taken time for execution isreal 0m0.001suser 0m0.000ssys 0m0.001sor using some cute trick we can get this with cut commandcut -d ““ -f 5 emp.lst# after -d press enter ,it means delimiter is newlineIt has taken time for execution isreal 0m0.001suser 0m0.000ssys 0m0.001sAnalysis: comparing above commands 'head' command taken maximum...
Posted by venu k
6 comments | 1:50 AM
· Resource-intensive tasks, especially where speed is a factor (sorting, hashing,etc.)Procedures involving heavy-duty math operations, especially floatingpoint arithmetic, arbitraryprecision calculations, or complex numbers(use C++ or FORTRAN instead)· Cross-platform portability required (use C or Java instead) Complex applications, where structured programming is a necessity (need type-checking of variables, function prototypes, etc.)· Project consists of subcomponents with interlocking dependencies Extensive file operations required (Bash is...
Subscribe to:
Posts (Atom)