in reply to batch query - win32

Script3.pl would be run if script2.pl died.

To prevent it, use

script1.pl script2.pl && script3.pl

Script2 will always be run regardless of how script1 exits. Script3 will only be be run if script2 succeeds -- Ie. returns 0, which it won't if it dies or exits with any value other than 0.

You can also do

script1 || script2;

In which case, script2 will only be run if script1 fails.

P:\test>perl -e"exit 1" && echo succeeded || echo failed failed P:\test>perl -e"exit 0" && echo succeeded || echo failed succeeded P:\test>perl -e"die" && echo succeeded || echo failed Died at -e line 1. failed

You can also group commands

(prog1 && prog1) || (prog3 || prog4)

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!
Wanted!