Guest User

Untitled

a guest
Jul 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # CodeMonkey 3000
  4. # version 0.2
  5.  
  6. myMarkList=('. ' ', ' '! ' '? ' '\n' )
  7. _words=/usr/share/dict/german
  8.  
  9. #check for words
  10. if [ ! -s $_words ]; then
  11. echo No words found at \"${_words}\"!; exit 1
  12. fi
  13.  
  14. #check for shuf
  15. if ! command -v shuf > /dev/null; then
  16. echo "shuf needs to be installed!"; exit 1
  17. fi
  18.  
  19. function getRandomMarker {
  20. _markIndex=$(( $RANDOM % ${#myMarkList[*]} ))
  21. _mark=${myMarkList[ ${_markIndex} ]}
  22. printf "$_mark"
  23. }
  24.  
  25. _sleepTime=0.2
  26. _wordCount=6
  27.  
  28. while true
  29. do
  30. echo -n $(shuf -n $(($RANDOM % $_wordCount + 1)) $_words); getRandomMarker
  31. sleep $_sleepTime
  32. done
Add Comment
Please, Sign In to add comment