Previous Topic: copy, cp Commands--Copy Files and Directories (Funclets)Next Topic: DBG_PROMPT_LINE Command--Break Script Execution for Inspection With Line Numbers (Cmdlet)


DBG_PROMPT Command--Break Script Execution for Inspection (Cmdlet)

The DBG_PROMPT command (cmdlet) interrupts script execution and displays an interactive prompt to evaluate expressions in the current script context. Typically used for inspecting current variable values, the debug prompt reoccurs until an empty input line is entered.

The command has the following syntax:

DBG_PROMPT [prompt]
prompt

Specifies a string with optional prompt to display. When using several prompts, the prompt can be used to indicate the location that triggered the interruption.

Default: "Dbg> "

Examples

Break during the last iteration of the loop:

for(i=0; i<11; i++)
{
    if(i==10)
    DBG_PROMPT
    ? i
}

Break using a custom prompt:

for(i=0; i<11; i++)
{
    if(i==10)
    DBG_PROMPT "i==10> "
    ? i
}

See also:

DBG_PROMPT_LINE Command--Break Script Execution for Inspection With Line Numbers (Cmdlet)