Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #./bin/bash
- #starting the time
- Start=$SECONDS
- #argument subject
- math=$1
- Filename=./math/questions.txt
- #Asking for Firstname
- echo What is your Firstname?
- read -r firstname
- #asking for lastname
- echo What is your lastname?
- read -r lastname
- #welcome first and lastname
- echo "Please answer the following questions $firstname $lastname"
- #Using loop to print questions and pormpt user to answer
- while read -r question <&3;
- do
- read -r -p "$question " answer
- echo "User typed '$answer'"
- done 3<"$Filename" >> "./math/${lastname}_${firstname}_$1.txt"
- #Total Time
- Total_Time=$(( SECONDS - a ))
- echo "$Total_Time seconds Total time taken to run the script" >> "summary.txt"
- ~
- ~
- ~
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement