11.07.2015 Views

NetEx EFT213 Reference Manual Rel 5.4

NetEx EFT213 Reference Manual Rel 5.4

NetEx EFT213 Reference Manual Rel 5.4

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using the ON (ERROR/INTERRUPT) CommandA useful command for building more robust scripts is the ON command. ON has the format:CommandONParameterexception [action]Where:exceptionactionis any one of the following:ERRorINTerruptLOCal_errorREMote_erroron <strong>NetEx</strong>/eFT error perform actionon keyboard interrupt perform actionon LOCAL command error perform actionon REMOTE command error perform actionis any valid <strong>NetEx</strong>/eFT command or alias, the most likely of which being:CONTinueExitGOTOInputTEXTignore the exceptionexit the current <strong>NetEx</strong>/eFT sessionGOTO a specified labelinput a specified <strong>NetEx</strong>/eFT scriptdisplay a messageturn off the specified exceptionIf action is more than one command, the results are unpredictable.The ON command allows a user to catch any one of the exceptions listed above and perform a predefined action.It is most useful within <strong>NetEx</strong>/eFT scripts for tailoring exception handling. ON commands generallyappear at the beginning of a <strong>NetEx</strong>/eFT script since they set up actions to be taken on future processing withinthat script. For example, the following script catches any keyboard interrupt (initiated by the user), and automaticallycauses the session to terminate:* Cause keyboard interrupt to exit session*on interrupt exitconnect hosta guest netexsend src_filedisconnectThe ON INTERRUPT exception as shown above, establishes an alternative action to be taken in the case of auser generated keyboard interrupt. By default, without an ON INTERRUPT specified, <strong>NetEx</strong>/eFT terminatesall input levels (if within nested input scripts), and returns to the interactive level. If the INPUT CONTINUEqualifier was set, <strong>NetEx</strong>/eFT terminates only the current input level and continues processing in the next levelup.The ON ERROR exception establishes an alternative action to be taken when a <strong>NetEx</strong>/eFT error occurs.Without an ON ERROR specified, <strong>NetEx</strong>/eFT terminates all input levels (for nested input scripts), and beginsprocessing at the interactive level. If the INPUT CONTINUE qualifier was set, <strong>NetEx</strong>/eFT displays the errorbut continues processing the next command. The ON ERROR command allows for more flexibility on anerror condition.The ON LOCAL_ERROR and ON REMOTE_ERROR exceptions give the user the ability to take specialaction when a LOCAL or REMOTE host command fails. On hosts that support it, a special LOCAL orREMOTE STATUS qualifier will be set reflecting that host’s error code for the particular error condition.REF-eFT213-R<strong>5.4</strong>-08 Advanced Local User’s Guide Page 95

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!