Script shell to display lines of a file in reverse order, Programming Languages

W.A.S.S to display all the lines of a file in reverse order.

 

Program

 

# W.A.S.S to display all the lines of a file in reverse order.

 len=`cat good.sh | wc -l`

while test $len -gt 0

do

clen=`head -n$len good.sh | tail -n1 | wc -c`

clen=`expr $clen - 1`

while test $clen -gt 0

do

    ch=`head -n$len good.sh | tail -n1 | cut -c$clen`

    echo -e "$ch\c"

    clen=`expr $clen - 1`

done

echo ""

len=`expr $len - 1`

done

 

Output

 

fi

fi

   echo "Good Morning!"

else

    echo "Good Afternoon!"

then

   if test $str -gt 12

else

 

   echo "Good Evening!"

then

if test $str -gt 16

str=`date +%k`

Posted Date: 9/26/2012 7:59:32 AM | Location : United States







Related Discussions:- Script shell to display lines of a file in reverse order, Assignment Help, Ask Question on Script shell to display lines of a file in reverse order, Get Answer, Expert's Help, Script shell to display lines of a file in reverse order Discussions

Write discussion on Script shell to display lines of a file in reverse order
Your posts are moderated
Related Questions
Question: (a) In JavaScript, the Window Object is commonly used to request information from a user or to output some results. Give three ways how to create instances of the

Write a program to check whether a car will crash. There is an obstacle at a certain distance (say 100 m) and the car is travelling at a certain speed (try it with some different s

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Complete the following program to move a value of 0xFFH to PORTB LIST p=18f4550 #include org 0x0000 movlw 0x00 _________ movlw 0xFF movwf PORTB end .

What will be the output for the following instruction if CX=9087H and AX=9090H? 1) BTR AH,2? 10010000=10010000 2) BTC CX,9?1001000010000111=1001000110000111 3) NEG AX?

How Can I Retrive Unicode CSV File the ADO.net VB.net

write a program to sort the file sequential order and store on magnetic tape and print sorted tape as the output of the program.

VARIATION OF PARAMETERS - HIGHER ORDER DIFFERENTIAL EQUATIONS We now require taking a look at the second method of finding a particular solution to a differential equation

What is JVM-Java Virtual Machine  A JVM stands for java virtual machine. This is virtual computer or an abstract computer that runs the complied java programs. In fact JVM is

The following is the process an account holder of eBroker, a discount online brokerage firm, uses to sell stocks.  The user first logs in by entering the username and password.