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

How can I send a mail with a compressed file as an attachment?

556


What is bash eval?

545


Explain about login shell?

631


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

2029


c program to display the information of given file similar to givan by the unix or linux command ls -l

1691






What is echo in shell?

632


How to print the first array element?

550


What is another name for a bash shell script that you might see?

1006


What is a shell script in windows?

583


What is the lifespan of a variable inside a shell script?

1118


What are the different variables present in linux shell?

608


What is the significance of the shebang line in shell scripting?

527


What is eval in shell script?

643


Is shell scripting a programming language?

572


How to write a function?

590