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

Which shell is the best?

566


How to calculate the number of passed arguments?

545


How to print the first array element?

546


what is info area how many types?

2277


How do you debug a script?

556






What is the way to do multilevel if-else's in shell scripting?

648


What is a batch file used for?

553


What is bash command used for?

571


What is inside a seashell?

627


What will happen to my current process when I execute a command using exec?

526


Where is bash history?

502


How can any user find out all information about a specific user like his default shell, real-life name, default directory, when and how long he has been using the system?

705


What does it mean to debug a script?

560


How do we create command aliases in a shell?

528


Why is a script important?

556