in reply to looping prob

perl -e 'while (my $var= <STDIN>) { $run ="awk -f work_5messages.awk /home/gprs/newvanu/Hull-r54283_Run/l +ogs/$var >logfile.log" ;`$run`; }'

Take from Re: shell prob, of which I underlined at least a shortcoming.

the above is a (bash)shell script program.....the above code executes $run on the shell only once.....

The above is not a shell script, it' a Perl script. The above executes $run with a different value taken from STDIN each time you feed it something on STDIN, until you end it with CTRL-D.

i want $run to be executed after every 2 sec.....how do i set this timer........

either read perldoc -f sleep or perldoc -f alarm.

and i want this loop to be infinite...but then how can i exit out of it on the prompt.

while (1) { ... }; and I don't understand the prompt thing.

you guys have been very kind to me so far....just one last favor.. vineet

Just one last favour: please do not start new threads for stuff that fits in previous ones!