Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #./bin/bash
- #arugment for subject
- math=$1
- #inputfile
- input=./math/questions.txt
- #enter firstname
- echo "Please Enter Your Firstname:"
- read -r firstname
- #enter lastname
- echo "Please Enter your Lastname:"
- read -r lastname
- #while loop
- while read -r question <&3;
- do
- start=$SECONDS;
- read -r -p "$question " response;
- delay=$(( SECONDS - start ));
- echo "delay: $delay"
- echo "User typed answer '$response'"
- done 3<"$input" >>"${lastname}_${firstname}_$1.txt"
- #total time spent
- echo total time $delay seconds >>"summary.txt"
- #output wc
- wc -w "${lastname}_${firstname}_$1.txt" >>"summary.txt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement