ipw969 / CMPT332

0 stars 0 forks source link

Assignment 1: Part B ~ Bash Script #8

Closed iainworkman closed 8 years ago

iainworkman commented 8 years ago

Write an interactive shell script that executes Parts A.1, A.2, A.3 or A.4 (bonus) according to the user's instructions. The shell script reads the appropriate values from the user and then invokes the corresponding program with the corresponding command line arguments. The structure you use for this part of the program is up to you, but you must do this in a loop until the user wishes to quit. Obviously, part A.1 only works on Windows, so there should be a check to see that the user is on the proper architecture for the program to be run. A standard format for the interface is required. Therefore, please code your shell program to the following standard.

partB.bash version where version is one of A1, A2, or A3 (or A4 for the bonus part). You are free then to develop an interactive menu, and provide error checking, but also make it so that the input can come from a file, such as the following:

partB.bash version < inputfile This should allow a user to provide arguments to the program interactively in a loop until the end of file is reached. Have the user input contain 3 integers on each line. NOTE: You should check for invalid input in the bash script as well as in the C program (things like negative numbers, strings, etc). Note: Phase 1 has 5 marks for Part B. Phase 3 has 5 marks for Part B. Hand in this script for all 3 phases.