The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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




Thread: Random
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-24-2007
keyvan keyvan is offline
Registered User
  
 

Join Date: May 2007
Posts: 14
Quote:
Originally Posted by anbu23
Code:
number=$(( RANDOM % 21 + 1 ))
word=$( sed -n "$number p" words_list_file )
letters=$(echo $word | wc -c)
letters=$(( $letters - 1 ))
template="$(echo $word | tr '[a-z A-Z 0-9]' '.')"
remaining=$letters
what can be used instead of sed, as i dont know anything about sed and rather learn shell scripting first and then look at sed, also just so i can understand this better, the random word file, needs to one word per line and numbered for this to work??

You are a star

Keyvan

Last edited by keyvan; 05-24-2007 at 08:25 AM.. Reason: more information