random_word()
{
if [ -z "$all_words" ]
then
sed '1s/,/ /g' random_words_file | read all_words
set -A words -- ${all_words}
fi
word_index=$(( $RANDOM % ${#words[@]} ))
echo ${words[$word_index]}
}
word=$(random_word)
random_word()
{
if [ -z "$all_words" ]
then
sed '1s/,/ /g' random_words_file | read all_words
set -A words -- ${all_words}
fi
word_index=$(( $RANDOM % ${#words[@]} ))
echo ${words[$word_index]}
}
word=$(random_word)
Jean-Pierre.
Jean i cant use sed in any of my scripting.. dont ask me why but thats the harsh truth. how can the above script be changed to remove the sed section?
np at all... i am trying to learn shell scripting and the only way for me to learn is to ask questions, and since i have no teachers or instructors to fall back on, then i can only use these forums to learn as much as i can. Please except my sincere apology if this post has offended any one.
Hello all,
I have a tricky question! (at least for me it is!). I'll try to explain it carefully here. Hope you can help me solving the whole or even parts of it! Here it is:
I have a big input 0\1 table as a very simplified one is shown below:
(The last row and column are the sum and... (0 Replies)