The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 06-10-2009
chilli1988 chilli1988 is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 3
I have not test it yet, because im still dowloading opensuse
could this work?

while read line
do

words = wc –w $line // counting the words of current line

If [ $(($words % 2)) –eq 0] Then // see if number of words is even
echo $File1 | tr '[a-z]' '[A-Z]' < $File2 // if even, change all to uppercase and copy to another file

Else
echo $File1 | tr '[A-Z]' '[a-z]' < $File2 // else; odd, change all to lowercase

Fi

Done < File1