Create source code, compile it, and produce a script with test cases demonstrati
ID: 3865798 • Letter: C
Question
Create source code, compile it, and produce a script with test cases
demonstrating the correctness of the following programs:
1. Write a program in C using stat() which receives a file name on the
command line and displays on the monitor the correct answer to the
question of whether the user of the program is in the group of the owner of
the file.
2. Use a single pipe in a C program and create 3 child processes. Each child
process should prompt the user to enter a character and then writes it into
the pipe. The parent process should read from the pipe and display the
character with the largest ASCII value.
3. Create a shell script which displays on the screen the following data:
a. the current time and date
b. the id of the user
c. the full path name of the users home directory
d. a recursive list of all the files under the users home directory in
sorted order
Explanation / Answer
3-You should use
mkdir "$(date +"%d-%m-%Y")"
cd "$(date +"%d-%m-%Y")"
In the extreme case a day passes between the first and the second statement, that won't work. Change it to:
d="$(date +"%d-%m-%Y")"
mkdir "$d"
cd "$d"
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.