#ghostplay <directive> [<parameters>...]
Normally, ghostplay execute statement by one line.
If you want to execute multiline statement at once, use batch
directive.
Execute at once, from batch
directive to end
directive.
Use it inside of batch
directive to end
directive,
execute the statements so far.
Execute the statements from silent
directive to end
directive,
but not typing (not showing on screen).
Types the statements from fake
directive to end
directive,
but not execute.
End of batch
directive, silent
directive, and fake
directive.
Sleep specified seconds.
If you want to change default behavior, (re)define the function.
###ghostplay_custom_prompt
If you want to change prompt, redefine the ghostplay_custom_prompt
function.
Example (Simple $ only prompt)
ghostplay_custom_prompt() {
printf '$ '
}
###ghostplay_custom_sleep
ghostplay use sleep
command to sleep. sleep
command assume to can use fractional value. If you are using sleep
command that can not use fractional values, you will need to redefine ghostplay_custom_sleep
function.
Example (Using perl)
ghostplay_custom_sleep() {
perl -MTime::HiRes=sleep -e "sleep($1)"
}
###ghostplay_cleanup_handler
Called after end of script (include Ctrl+C). You can write cleanup code.
###ghostplay_before_prompt_hook
Called before the prompt is displayed. (Default: none)
###ghostplay_after_prompt_hook
Called after the prompt is displayed. (Default: ghostplay_sleep 0.5
)
###ghostplay_before_type_hook
Called before type one character. (Default: ghostplay_sleep 0.02
)
###ghostplay_after_type_hook
Called after type one character. (Default: none)
You can use those variables in your script.
Name | Value |
---|---|
GP_USERNAME | User name |
GP_HOSTNAME | Host name |
GP_SOURCE | File name of script |
GP_LF | New line (0x0A) |
GP_ESC | Escape code (0x1B) |