The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-28-2008
bisla.yogender bisla.yogender is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 30
Question

Thanks thats working for me...

But my concerns was not about to put list number in front of ls but my concern is how to print a count that for which instance a loop is going to execute:

suppose i have file "yogi.txt"

and i write down a code as

for n in yogi.txt
do
echo "$n"
done

Output is:
yogi
is
not a
good
progrmmer

but what should i do if i want my output to be as follow:

1.) yogi
2.) is
3.) not a
4.) good
5.) programmer