Create a shell script to manipulate passwd file in directory

Assignment Help Operating System
Reference no: EM131299760

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.

Reference no: EM131299760

Questions Cloud

How does a revocable living trust affect estate taxes : Value of Estate. Why is it important to calculate the value of your estate periodically? 10. Estate Planning. Beyond the will, what does estate planning involve?
Java class library collections framework : What support exists for linked lists in the Java Class Library Collections Framework? Do you think this support is easy to understand and use? Why or why not?
Permanent funds are classified as : During the current year, the earnings from this gift were $24,000. The earnings from this gift should generally be considered revenue to which of the following funds?
Explain way that business organization use mobile technology : Next, determine at least two ways that business organizations use mobile technologies to become more efficient, productive, and profitable. Support your response.
Create a shell script to manipulate passwd file in directory : Create a shell script (lab2_q2.sh) to manipulate passwd file in /etc directory to automate some tasks. Filter list1.txt file containing the word "ball". Display on the screen and also save to the file ball.txt.
What is appropriate entry when the city receives interest : Previously Atomic City had issued bonds with a face value of $10 million to construct a new city hall. Because the money will not be needed for several months, the city invested the bond proceeds in U.S. Government securities. Assume that the city..
Keyboard device stored keystrokes in a buffer : Suppose that the keyboard device stored keystrokes in a buffer until it was full then sent the entire buffer for processing. What would be some adverse consequences? (Two or three sentences should be adequate to answer this question)
Personal loan officer at first national bank : Abagail Nelson, a 25-year-old personal loan officer at First National Bank- How much will she have accumulated when she turns 65 if she invests in equities and earns 8 percent on average?
What is an irrevocable living trust : Contributions. How can contributions to charitable organizations help in estate planning?

Reviews

Write a Review

Operating System Questions & Answers

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd