UNIX/Linux Programming Answers

Questions: 170

Answers by our Experts: 135

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Develop a stopwatch with lap counter and total time calculator. The

program will create two processes and they will start calculating time.

One process will be used to calculate total time and the other will calculate

lap time. The total time calculator process will keep on calculating time.

In the lap time, calculator process when it reaches lap time limit, the

process will display lap number and set its counter to zero and start

calculating again. Take input of lap time and number of laps from the user

and start the program. At the end, display total time from total time

calculator process.


Develop a stopwatch with lap counter and total time calculator. The

program will create two processes and they will start calculating time.

One process will be used to calculate total time and the other will calculate

lap time. The total time calculator process will keep on calculating time.

In the lap time, calculator process when it reaches lap time limit, the

process will display lap number and set its counter to zero and start

calculating again. Take input of lap time and number of laps from the user

and start the program. At the end, display total time from total time

calculator process.


Write a program which take string from user and you have to do following tasks with the string:

1. Reverse

2. Find Length

3. Sort

You have to create child of child’s as given below process tree for each task and each child exec with the image of program of particular task. Print the string after each operation. 


P

C

C

C


How many number of processes will be created in the following program? Prove your answer by making a replica code that will count no of processes created.


int main()

{

  fork();

  fork();

  fork();

  fork();

}



Develop a stopwatch with lap counter and total time calculator. The program will create two processes and they will start calculating time. One process will be used to calculate total time and the other will calculate lap time. The total time calculator process will keep on calculating time. In the lap time, calculator process when it reaches lap time limit, the process will display lap number and set its counter to zero and start calculating again. Take input of lap time and number of laps from the user and start the program. At the end, display total time from total time calculator process.


1.   Write a Linux shell script that allow the user to enter a choice based on the following options: 

 

 

A – Delete a file in current directory B – Create a directory in current directory. 

C – Change a file access mode to 755. D – Rename a file to another name E – Copy a file to another directory. 

 

If the user entered any other choices than the above, prompt the user to pick only A – E.  


1.   Write a Linux shell script to perform the following tasks: 

 

a.   Display current date and time 

b.   Display current working directory 

c.   To check whether a sample file is a directory 

d.   Display details of all files/directories in current working directory 

e.   To check whether a sample file is readable, writable, and executable. 


Write a shell program which allows user to add data in a file emp.dat . Allow user to enter data from keyboard. The format for data file is given below

empid: ename: sal: age

If empid exits in a file then do not allow duplicate value to be inserted into file.

Write a menu driven shell script to list all the files of the current directory having read, write permission and read write permission to the user.

a.     Read permission

b.     Write permission

c.      Read and write permission

d.     exit 

Write a shell program where user will take name of person. The program will return corresponding age of person on console .Shell will read value from a file called as info.txt where user information is stored in the format mentioned below

Name:Age

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS