Question: Question ( Shell Scripting ) In this exam, you will read a text from a text file and display the content on screen. The content
Question Shell Scripting
In this exam, you will read a text from a text file and display the content on screen. The content of the file
includes only three ASCII characters: and O characters, and a delimiter with no spaces between them.
After reading the file, the user will check if the rows, columns, or diagonals have the same symbols. The file
will consist of symbols, three in each line figure
Figure : Sample of the content of a text file printed on screen
Requirements:
Accept the player's name as input.
Print the player's name on the screen and also to an output file.
Accept the name of a text file as input, ensuring its existence.
Read the entire content of the text file.
Print the content of the text file on the screen.
Display the current time, including hours, minutes, and seconds on screen.
Write the current time to the content of the output file.
Check if the symbols in any row are the same; if so print 'Symbols in at least one row are the same' on
the screen. Otherwise, print No match across rows'
Check if the symbols in any column are the same; if so print 'Symbols in at least one column are the same'
on the screen. Otherwise, print No match across columns
Check if the symbols in the forward diagonal backward diagonal are the same; if so print A
match across at least one diagonal' on the screen. Otherwise, print No match across diagonals"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
