Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- WORDCOUNT="$#"
- SENTENCE="$*"
- NUMBER="0"
- for x in $SENTENCE ; do
- NUMBER=$(($RANDOM % $WORDCOUNT + 1))
- while [ ! -z ${ARRAY[$NUMBER]} ]; do
- NUMBER=$(($RANDOM % $WORDCOUNT + 1))
- done
- ARRAY[$NUMBER]=$x
- done
- echo ${ARRAY[*]}
Add Comment
Please, Sign In to add comment