Question: Linux Bash .sh file. I was hoping for help compiling this code. Deliverables: Upload your script program file, ifeq Upload your script run results file,
Linux Bash .sh file.
I was hoping for help compiling this code.
Deliverables:
Upload your script program file, ifeq
Upload your script run results file, result
Creating a Bash Script File
After you are satisfied with your hands-on log session in Assignment 7-1, create and execute a bash script using a text editor of your choice that does the following:
Searches a file for two strings and prints which is more frequent.
Usage: ./ifeq
The script file, ifeq, will make use of positional variables and test conditionals.
Write a script called ifeq that does the following:
Lists current date
Displays your username
Verifies that the file exists
Searches the file for two strings and prints which is more frequent
Returns status code (0 file exists, error if file does not exist)
Notes:
Display all standard output to the file, result.
Provide 2 test runs of the script: 1st run demonstrates error condition, 2nd run successful completion. Append all standard output for both runs into the result file.
Example test files include:
$ cat t1
a
b
b
$ cat t2
a
b
b
a
$ cat t3
a
b
a
Be sure to upload both the script file ifeq as well as the file result as attachments to complete your Assignment 7-2 submission.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
