Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

compiled. Let's write a script that compiles C programs. The script will support the following command-line syntax: ./compile exec [.in] [.args] file.{c,o} [compiler arguments] std=c99

image text in transcribedimage text in transcribed

compiled. Let's write a script that compiles C programs. The script will support the following command-line syntax: ./compile exec [.in] [.args] file.\{c,o\} [compiler arguments] std=c99 -g -Wall but there could be others as well. The following are therefore all legal executions of the script ./compile myprogram main.c ./compile myprogram main.c file1.c file2.c/u2/cs 1361/pub/common/cs136.0 ./compile exec test.in main.c -g file2.c/u2/cs1361/pub/common/cs136.0 ./compile yolo test.args main.c file1.c -std=c99 -Wall/u2/cs1361/pub/common/cs136.0 -g ./compile a.out test.in test.args main.c/u2/cs1361/pub/common/cs136. -I/u 2/cs1361/ pub/common/ compiler should be allowed to appear on the same stream and the script should exit with the same exit code as set by the compiler. the compile script). You may assume that if . in or . args files are provided, they exist and are readable. were provided). If these preconditions are not satisfied, the script outputs an appropriate error message on the standard error stream and exits with the status code 5. This completes the script's specifications. What follows are tips for students who need extra help. Testing your script yourself: programs. To run your script, first make sure that it is executable by setting the execute permission: chmod a+x compile Following are some of the programs made available to you: programming. Your script should be able to compile this program using the following command: our script with arguments, we need this program. We have also provided a sample test. args file. You can test your compile script by executing: ./compile myprogram/u2/cs1361/pub/lab4/q1/Args/test.args/u2/cs136l/pub/lab4/q1/Args/printArgs.c The expected output is present in test. expect. your script using the following command: Implementing the optional arguments makes this question a little challenging. Here are some additional hints: command $1 will contain what was previously in $2, $2 will contain what was previously in $3 and so on. the loops lesson in the Bash scripting module. zero. Name the text file containing your script compile and upload to the appropriate Marmoset project

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions