Advertisement
shadowsofme

Untitled

Dec 5th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.31 KB | None | 0 0
  1. function next() { echo $1; }
  2. function rest() { shift; echo $*; }
  3. space=" "
  4.  
  5. rm results.txt
  6. function shift() {
  7.     strings=$1
  8.  
  9.     for i in $strings; do
  10.         strings=$(rest $strings)$space$(next $strings);
  11.         if [ $(next $strings) != 'and' ]; then
  12.             echo $strings;
  13.             echo $strings >> results.txt;
  14.         fi
  15.     done;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement