Question: Please help to implement the functions To do functions: ERR_USAGE=Usage: -/ compare.sh myprog solprog ./ compare.sh -i test_input myprog solproch TY_OUTPUT=tmp_prog.txt SOL_OUTPUT=tmp_sol.txt DIFF RESULTS=results.txt function
Please help to implement the functions


To do functions:
![function ??? { echo "WARNING! TODO on line ${BASH_LINENO[O]} not implemented (or](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f39d2cd0d36_51666f39d2c6d0e1.jpg)
ERR_USAGE="Usage: -/ compare.sh myprog solprog ./ compare.sh -i test_input myprog solproch TY_OUTPUT="tmp_prog.txt" SOL_OUTPUT="tmp_sol.txt" DIFF RESULTS="results.txt" function ??? { echo "WARNING! TODO on line ${BASH_LINENO[O]} not implemented (or ??? was "not removed) "1>&2 function main { if [ "$#" -le 1 ] || [ "$#" -eq 3 ] || [ "$#" -ge 5 ]; then print_error_and_exit elif [ "$#" -eq 2 ]; then check_permissions "$ 1" check_permissions $2! prog_compare "$ 1" elif [ "$#" -eq 4 ]; then if [ "$1" != "-i" ]; then print_error_and_exit else check_permissions "$3" check_permissions "$4" prog_compare_with_input "$2" "$3" "$4" fi else print_error_and_exit fi ] . main "$@" Function that compares the output of two different programs USAGE prog_compare myprog solprog INPUT myprog: name of script or program that will be tested against the solution solprog: name of the solution implementation of the program Eunction prog_compare { TODO Set incoming arguments to correct variables program=??? solution=??? TODO Run both the program and the solution and save the output to the correct temporary output file Cint: myprog should save to the filename stored in MY OUTPUT and solprog should save to the filename stored in # SOL_OUTPUT) ??? ??? check_results "${MY_OUTPUT)" "${SOL_OUTPUT)" clean prog compare with input Function that compares the output of two different programs given an input test file (redirect the input file into the stdin of the program you specify) USAGE prog_compare_with_input testfile myprog solprog INPUT testfile: name of file that will be fed to stdin of the programs under test myprog: name of script or program that will be tested against the solution solprog: name of the solution implementation of the program Function prog_compare_with_input { TODO Set incoming arguments to correct variables program=??? solution=??? input_file=??? TODO Check if the input file exists if ???; then TODO If it does exist, run both the program and the solution using # input_file as the input to the two programs and outputting to the # correct temporary output file ??? ??? else print_error_and_exit fi check_results "${MY_OUTPUT)" "${SOL_OUTPUT)" clean ERR_USAGE="Usage: -/ compare.sh myprog solprog ./ compare.sh -i test_input myprog solproch TY_OUTPUT="tmp_prog.txt" SOL_OUTPUT="tmp_sol.txt" DIFF RESULTS="results.txt" function ??? { echo "WARNING! TODO on line ${BASH_LINENO[O]} not implemented (or ??? was "not removed) "1>&2 function main { if [ "$#" -le 1 ] || [ "$#" -eq 3 ] || [ "$#" -ge 5 ]; then print_error_and_exit elif [ "$#" -eq 2 ]; then check_permissions "$ 1" check_permissions $2! prog_compare "$ 1" elif [ "$#" -eq 4 ]; then if [ "$1" != "-i" ]; then print_error_and_exit else check_permissions "$3" check_permissions "$4" prog_compare_with_input "$2" "$3" "$4" fi else print_error_and_exit fi ] . main "$@" Function that compares the output of two different programs USAGE prog_compare myprog solprog INPUT myprog: name of script or program that will be tested against the solution solprog: name of the solution implementation of the program Eunction prog_compare { TODO Set incoming arguments to correct variables program=??? solution=??? TODO Run both the program and the solution and save the output to the correct temporary output file Cint: myprog should save to the filename stored in MY OUTPUT and solprog should save to the filename stored in # SOL_OUTPUT) ??? ??? check_results "${MY_OUTPUT)" "${SOL_OUTPUT)" clean prog compare with input Function that compares the output of two different programs given an input test file (redirect the input file into the stdin of the program you specify) USAGE prog_compare_with_input testfile myprog solprog INPUT testfile: name of file that will be fed to stdin of the programs under test myprog: name of script or program that will be tested against the solution solprog: name of the solution implementation of the program Function prog_compare_with_input { TODO Set incoming arguments to correct variables program=??? solution=??? input_file=??? TODO Check if the input file exists if ???; then TODO If it does exist, run both the program and the solution using # input_file as the input to the two programs and outputting to the # correct temporary output file ??? ??? else print_error_and_exit fi check_results "${MY_OUTPUT)" "${SOL_OUTPUT)" clean
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
