Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. #./bin/bash
  2. #starting the time
  3. Start=$SECONDS
  4. #argument subject
  5. math=$1
  6. Filename=./math/questions.txt
  7. #Asking for Firstname
  8. echo What is your Firstname?
  9. read -r firstname
  10. #asking for lastname
  11. echo What is your lastname?
  12. read -r lastname
  13. #welcome first and lastname
  14. echo "Please answer the following questions $firstname $lastname"
  15. #Using loop to print questions and pormpt user to answer
  16. while read -r question <&3;
  17. do
  18. read -r -p "$question " answer
  19. echo "User typed '$answer'"
  20. done 3<"$Filename" >> "./math/${lastname}_${firstname}_$1.txt"
  21. #Total Time
  22. Total_Time=$(( SECONDS - a ))
  23. echo "$Total_Time seconds Total time taken to run the script" >> "summary.txt"
  24.  
  25. ~
  26. ~
  27. ~
  28. ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement