From: "Mrtlc" <[EMAIL PROTECTED]> > I have a script gonnadie.pl > > ##gonnadie.pl > do_sth > die "blah blah"; > > gonnadie.pl is called by a DOS batch file x.bat > > REM - x.bat > perl gonnadie.pl > > > x.bat is called by y.bat > > REM - y.bat > x.bat > > When y.bat is run, the OS treats x.bat ends sucessfully, how can I > make y.bat dies when gonnadie.pl dies?
If you do it like this the x.bat never returns. Try x.bat: @echo off echo in x.bat y.bat @echo off echo started y.bat x.bat echo back in y.bat You have to use call x.bat I'm not sure what exactly do you need but this seems to work fine: x.bat @echo off perl -e "if ($ARGV[0] eq 'OK') {print 'OK'} else {die 'empty'}" %1 if %errorlevel% == 255 goto Error echo x.bat OK goto End :Error echo x.bat error :End y.bat @echo off call x.bat %1 if %errorlevel% == 255 goto Error echo y.bat OK goto End :Error echo y.bat error :End HTH, Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]