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
Write your own version of the strcmp function string_compare. Supply a main program that will test each of the 3 differing outcomes. int string_compare(char *s, cha

We'll start this section off with the material which most text books that will cover in this section. We will take the matter from the Second Order chapter and expand this out to n

Your task is to write an application to analyse texts in a file.  Your application will employ  several kinds of text-analyser objects (which you also have to implement)  as descri

Explain, in your own words, how web designers can deal with CSS conflict resolution. What is the order of precedence between the different types of CSS (inline, embedded and extern

(a) Write a procedure called (lookup n t). This procedure has 2 arguments: n is the value being looked up, t is the AVL tree. The subtree with n as its root is returned (or '() if

Matlab Assignment # For each of the three datasets (data1.txt, data2.txt, and data3.txt in bnhw2q2.zip), cluster the data using k-means in Matlab, with k=2, 3, 4 and 5 using the pr

Define an Example of Switch Statement? estimate(number) int number; /* Estimate a number as none, one, two, several, many */ {       switch(number) { case 0 :

Example problem Imagine that  you  require  to create  a robot  that  will  roll up  close to a light  lamp  and  stop  a fixed distance from it.  The first question is, how w

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

How do i get back data from a FOR loop in order to print them on screen?