Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Operating System Expert

1. Write a shell script (lab2_q1.sh) to do the following:

a. Create list1.txt (use echo command) as:
Football
Basketball
Skates
Soccer ball
Golf ball
Shoes

b. Create list2.txt (use echo command) as:
Football
Basketball
Skates
Soccer ball
Tennis ball
Runners

c. Compare list1.txt with list2.txt and find the differences

d. Combine list1.txt and list2.txt one after the other, then sortthe datain reverse order and save it aslist_sort.txt

e. Join the two files list1.txt with list2.txt column wise

f. Filter list1.txt file containing the word "ball". Display on the screen and also save to the file ball.txt.

g. Count the number of lines which are unique in list_sort.txt file.

Paste the shell script and output in the solution document

2. Create a shell script (lab2_q2.sh) to manipulate passwd file in /etc directory to automate some tasks

a. Copy /etc/passwd file to your home directory as password.txtfile

b. Display the first 3 lines and last 5 lines of password.txt file to pass.txt file (use appropriate commands)

c. Copy login id, user name and home directory of all users whose name contains ben or dan (upper or lowercase) from password.txt (or /etc/passwd) , sort the data by user name and save to a file called users.txt

d. Ask the user to enter the username to search in password.txt file and store in a variable called userName.

e. Search password.txt whether the user entered in (d) exists or not. (i.e.) display the userid and home directory only (it should allow both uppercase and lowercase name)

f. Count the number of users whose name does not start with [a-c] in password.txt

g. Replace pass.txt to display the data separated by , and not :and also convert from lowercase to uppercase, save to a file called pass_new.txt and also display on the screen

h. Ask the user to enter the filename, permission value (absolute) and store in variables. Use these variables to set the permission of the file specified.

i. Display the date as Mon-dd-YYYY from the date command (use appropriate commands)

Paste the shell script and output in the solution document

3. Create a shell script (lab2_q3.sh) to do the following:

a. Count the number of files in your folder

b. Find the highest file size in your home directory

c. Create a variable called myshell which stores the current shell

d. Display the logon time, username and ip address of the users who logged on the machine and store in a file called who.log

e. Create two variables named the first variable first with the value 50 and second variable named second with the value 30. Create a third variable which adds first and second. Display the third variable.

f. Assign today's date to the variable named today using command substitution

g. Create a variable called list_files which consists of all filenames only in your directory (use command substitution)

Paste the shell script and output in the solution document.

Operating System, Computer Science

  • Category:- Operating System
  • Reference No.:- M92054408

Have any Question?


Related Questions in Operating System

Research types of operating systems that are currently

Research types of operating systems that are currently available and provide a scenario in which the operating system you chose would be appropriate to be used in this situation. Explain why you think the choice you made ...

Show all stepssuppose that the following processes arrive

Show all steps Suppose that the following processes arrive for execution at the times indicated. Each process will run the listed amount of time. in answering the questions, use non-preemptive scheduling and base all dec ...

Assignment -building a multi-threaded web server using c

Assignment - Building a multi-threaded web server using C and p threads, following the model from the lecture. Your program will have one thread acting as a dispatcher thread, listening fornetwork connections with reques ...

Catalog course descriptionin this course students carry out

Catalog Course Description In this course students carry out independent research in a significant technical area of information, network, and computer security. The student is to investigate a technical area, research i ...

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Briefly describe the following concepts and indicate how they are related in the context ...

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Consider a computer embedded in the control of a manned spacecraft. Would it require an ...

Question students working at individual pcs in a computer

Question : Students working at individual PC's in a computer laboratory send their files to be printed by a server that spools the files on its hard disk. Under what conditions may a deadlock occur if the disk space for ...

Question you are a security administrator responsible for

Question: You are a security administrator responsible for providing secure configuration requirements for new laptop deployments. After reading Module 2 of Certified Secure Computer User v2exercises, apply the configura ...

Discussion question this research assignment will give

Discussion Question : This research assignment will give further information on the nature and workings of multi-tasking and multi-processing operating systems. All information reported in this assignment is to be in the ...

Question description of lasa in this assignment you will

Question: Description of LASA: In this assignment, you will select a real-world operating system (can be for a PC, server, tablet, handheld, or embedded device). You will introduce the operating system and its components ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As