Script S1 (which copies .dat files from one directory1 to
another directory2) run continuously.
Write Script S2 which kills S1 first, compresses all .dat
files in directory1 and directory2 successfully, re-run
Script S1 and stops self i.e. S2.

Answer Posted / ganesh

Hi Vipul,

Script1 have to run continuously.. So,

Script1 should be

#!bin/sh

while true
do
cp directory1/*.dat directory2/
done

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is cmd a shell?

600


Determine the output of the following command: name=shubham && echo ‘my name is $name’.

535


I have 2 files and I want to print the records which are common to both.

704


What can scripts do?

669


How do we delete all blank lines in a file?

579






How do you create a shortcut in linux?

599


Give some situations where typing error can destroy a program?

730


Suppose you execute a command using exec, what will be the status of your current process in the shell?

589


how to get part of string variable with echo command only?

597


How to find all the files modified in less than 3 days and save the record in a text file?

617


What is a shell environment?

577


How does path variable work?

551


What does chmod do?

578


What is the first line in every perl script called?

559


What is a program shell?

572