Reference no: EM132619225
5103COMP Operating Systems - Liverpool John Moores University
Shell Scripting
Learning Outcome 1: Apply command-line tools provided by operating systems and their distributions.
Learning Outcome 2: Demonstrate problem-solving skills to create simple software solutions using command-line scripting.
Introduction
This is an individual coursework and all shell scripts should be your own work. Collaborative coding and copying code from online sources (this includes forums!) is plagiarism.
This assignment will assess your shell scripting skills as well as your knowledge of the file structure and shell tools of mainstream Linux distributions. You will be required to write bash scripts to solve the problems outlined in this specification.
Detail of the task
You need to write bash shell scripts that are able to accomplish the tasks outlined below. These script files should be submitted via the handler on Canvas. Some important points to note:
• All script files must be properly formatted and commented.
• You will lose marks if the script returns/displays information other than that requested.
• All script files must be ASCII without CRLF line endings (Unix/Linux)
Task 1 - Basic File System Control
Write a bash script for the following pseudo code:
1. # Task 1 Pseudo Code
2. Change to current user's home directory
3. Create folder named "My New Files"
4. List contents of current directory
5. Move inside the "My New Files" directory
6. For <count> to 10:
7. Create file named "File_<count>"
8. Add "This is file number: <count>" to file
9. List files and their permissions in the current directory
10. Change File_2 permissions to RWX for current user, group and others
11. Change File_4 permissions to RW for current user and group
12. Change File_8 permissions to RWX for current user
13. List files and their permission in the current directory
14. For all files in "My New Files":
15. Delete file if number in file name is odd
16. List files in current directory
17. Merge contents of all files in "My New Files" into a file called "Master"
18. Move the "Master" file to the current user's home directory
19. List the current directory
20. Show the contents of the "Master" file
Task 2 - Host Monitoring Script
Write a Bash script that displays the following information in the terminal console:
1) Machine Name, Kernel Version, Uptime and Current Time should be shown on one line using the pipe ( | ) as a delimiter.
2) The average round trip time (in milliseconds) for 4 ICMP echo/echo reply packets (ping) sent to/received from www.google.co.uk.
3) The top 5 CPU-consuming processes.
4) Both the free memory (in MB) and free swap (in MB).
5) The disk usage breakdown (in GB) of the current user's home directory.
6) Both the number of RX packets and number of TX packets for the loopback interface.
7) Both the number of listening TCP ports and number of listening UDP ports.
Task 3 - Advanced Scripting
Write the two scripts outlined below, which should perform the specified tasks:
Script 1
• Ask the user for two separate inputs: filename (string) and count (integer).
• The count input should be optional and unless specified its default should be 1. Your script should check the validity of the integer and whether a null/empty value has been supplied.
• Create an array of the same size as the count entered.
• Using an appropriate loop, populate the array with filenames (as specified in the input) in the format <filename>_<count> (e.g. myFile_1, myFile_2, ..., myFile_n)
• Pass this array to Script 2.
Script 2
• Accept the array passed from Script 1.
• Create a folder called "Task 3" in the home directory of the current user and change into this folder.
• For every filename in the array, create a file using the filename in UPPERCASE letters.
• For every file created, print the corresponding MD5 hash.
• For every file created, rename the files using lowercase letters.
• List files in the current "Task 3" directory.
• Print the words "Script" in red, "has" in blue and "finished" in green.
Attachment:- shell scripting.rar
Identify elements that appear to foster employee motivation
: When reviewing the descriptions of the work environments, identify elements that appear to foster employee motivation and group cohesion among employees.
|
What types of informal groups do you belong to in workplace
: What types of informal groups do you belong to in your workplace? How do norms of the informal groups to which you belong influence your behavior.
|
Provide the journal entries for each year
: Provide the journal entries for each year. Assume the stage of completion can be reliably determined. Exclude journal narrations
|
Identify actions manager can take at each stage of process
: Consider the Tuckman group stage process schema as discussed in Chapter 3 of your text. Identify specific actions a manager can take at each stage.
|
5103COMP Operating Systems Assignment
: 5103COMP Operating Systems Assignment Help and Solution, Liverpool John Moores University - Assessment Writing Service
|
What factors you would examine in your research
: Identify a generic organization (e.g., manufacturing plant, hospital, educational institution). You will use this same organization in your Final Project.
|
Review problem based on the organizational design
: More than ever, groups and teams are responsible for executing tasks in the workplace. Take a position on the following statement: All organizations should.
|
Why do you think it is important for the leader to embrace
: Watch The First Follower and discuss three things you learned from the video clip, providing examples. Also, explain the chain of leadership + follower.
|
What is the role of leadership as it relates to vision
: What is the role of leadership as it relates to vision, mission, and strategy in an organization? Give specific examples.
|