Advertisement
Guest User

Untitled

a guest
Aug 12th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #./bin/bash
  2. #arugment for subject
  3. math=$1
  4. #inputfile
  5. input=./math/questions.txt
  6. #enter firstname
  7. echo "Please Enter Your Firstname:"
  8. read -r firstname
  9. #enter lastname
  10. echo "Please Enter your Lastname:"
  11. read -r lastname
  12. #while loop
  13. while read -r question <&3;
  14. do
  15. start=$SECONDS;
  16. read -r -p "$question " response;
  17. delay=$(( SECONDS - start ));
  18. echo "delay: $delay"
  19. echo "User typed answer '$response'"
  20. done 3<"$input" >>"${lastname}_${firstname}_$1.txt"
  21. #total time spent
  22. echo total time $delay seconds >>"summary.txt"
  23. #output wc
  24. wc -w "${lastname}_${firstname}_$1.txt" >>"summary.txt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement