Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/bash
  2. if [ -e part1script.txt ]
  3.         then rm part1script.txt
  4. fi
  5.  
  6. a=0
  7.  
  8. function read {
  9.         if [ ! -s part1script.txt ]
  10.                 then echo 0 > part1script.txt
  11.         fi
  12.  
  13.         a = ` tail -n 1 part1script.txt `
  14.         (( a += 1 ))
  15.         write
  16. }
  17.  
  18. function write {
  19.         echo $a >> part1script.txt
  20. }
  21.  
  22. while [ $a -lt 10 ]
  23. do
  24.         read
  25. done
  26.  
  27. echo 'done'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement