daily pastebin goal
10%
SHARE
TWEET

BASH Word Scramble

metalx1000 Aug 19th, 2018 111 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. function scramble(){
  4.   local s=$* i
  5.   while((${#s})); do
  6.     ((i=RANDOM%${#s}))
  7.     echo -n "${s:i:1}"
  8.     s=${s::i}${s:i+1}
  9.   done
  10. }
  11.  
  12. scramble This is a test
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top