Thursday, May 1, 2008

A shell script can receive ‘one’, ‘two’ or ‘three’ as a command line argument. If the argument supplied is ‘one’ display it in bold, if it is ‘two’ di

A shell script can receive ‘one’, ‘two’ or ‘three’ as a command line argument. If the argument supplied is ‘one’ display it in bold, if it is ‘two’ display it in reverse video and if it is ‘three’ make it blink on the screen. If a wrong argument is supplied report it. Use a case control instructio.


# SS15

# Script to display messages in Bold/Underline/Blinking

# Usage SS15 one/two/three

clear

case $1 in

one) echo “\033[1m You entered one;;

two) echo “\033[7m You entered two;;

three) echo “\033[5m You entered three;;

*) echo Wrong argument supplied;;

esac

echo “\033[0m”

No comments: