Shell Script To Count English Language Articles Such As 'A', 'An' and 'The'

in Categories Decision Making, File-management last updated April 21, 2008

This script also covers following techniques:
=> Reading input text file line by line
=> Reading and processing words in input
=> Convert word to lowercase

Shell program to read two numbers and display all the odd numbers berween those two number

in Categories Academic, Decision Making last updated April 8, 2008

Shell script to read a number and write the number in words

in Categories Decision Making last updated April 5, 2008

Script logic is as follows:

a) First read number into a shell variable

b) Next get one digit at a time

c) Use simple case control structure and loop to find digit equivalent in words

Sample script to convert numbers into equivalent words

Menu Driven Shell Script

in Categories Decision Making last updated April 5, 2008

Explains how to write a menu driven Shell script, which has following options:
1. Contents of /etc/passwd
2. List of users currently logged
3. Present handling directory (working directory)
4. Exit

Take action as per selected option

Shell script to read a character (upper or lower), digit, special symbol and display message according to the character entered

in Categories Decision Making last updated April 5, 2008

This script uses sed command to find out all digits or upper characters. -z string (conditional expression) will return true if the length of string is zero.

Script logic

Read one character
[1] Use sed command to determine input character is digit or not (sed -e ‘s/[A-Z]//g’))

[2] Attempt to match regex [0-9] i.e. all digit against the pattern space

[3] If successful, replace that portion matched with replacement // i.e. do nothing.
If digits are in input, it will replace all those digit, and if input is only digit, nothing is left i.e. string is zero and that is what tasted with -z conditional expression.

Shell script to read a number and find whether the number is odd or even

in Categories Decision Making last updated April 5, 2008

Shell Script to read source file and copy it to target file

in Categories Decision Making last updated April 5, 2008