Starting from:
$29

$26.10

Assignment 1 A program in shell script

Questions: 1. Collect the following basic information about your machine using the​/proc​file system and answer the following questions: a. How many CPU and cores does the machine have? b. What is the frequency of each CPU ? c. How much memory does your system have? d. How much of it is free and available? What is the difference between them? e. What is total number of user-level processes in the system? ​ [5 marks] 2. A text file ​welcome.txt ​ consists of the following passage: “An operating system (OS) is system software that manages hardware, software resources, provides common services for computer programs. Every general-purpose computer must have operating system to run other applications.”
Write a program in shell script to display the followings: A. the number of unique words in the file.
B. the word which is present for maximum number of times in the file. ​[5 marks]
3. Suppose you have a fibonacci sequence of length n, where n is a positive integer and multiple of 3. Now you decide to cut down the sequence in three equalsegmentsanddo an element-wise sum of the first and third segments.Finally,youconcatenatethesecond segment to the summed segment. Write a program in shell script to represent these procedures. Display the results after each step. ​[8 marks] 4. A folder named ​OS contains four non-empty and one empty text files. Each of the non-empty files containsdifferentnumberofsentences.Writeaprograminshellscriptto copy the first sentence from each non-empty file to the empty file.Thesentencesshould be placed based on the ascending order of the size of the non-empty files. ​[8 marks]

More products