You are being tasked with creating a C-Shell program that will demonstrate what you have learned in this course. You will need to be sure to add the top line, which tells the Linux system what shell to execute the file in.

Access your Amazon Workspaces, and launch the Cygwin64 Terminal.

Once you are in the Linux environment, perform the following steps: Manually create a configuration file named “configFile.cfg,” which includes a list of at least 5 environment variables that each contain the name of a user. Each environment variable name and value should be unique. Create your program, setting the needed variables after the first line (interpreter line) of the program. Check to see if the configFile.cfg file exists, if it doesn’t display an error to the user and exit the program. Create a loop to read from the configFile.cfg, and place each of the lines read into an array element. Create a switch statement within the loop where each case will check what was read from the array in the respective iteration. Within each case, set the environment variable based on the value in the array element that was read from the configuration file. Once the loop has completed, create another loop to echo only the environment variable name, and display to the screen as well as displaying to an output file named “outputFile.txt.” After the final loop has completed, exit the program.

"Get 15% discount on your first 3 orders with us"
Use the following coupon

Order Now