Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Control+T in Terminal shows time snapshot' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Control+T in Terminal shows time snapshot
Authored by: Hal Itosis on Jan 30, '12 02:53:57PM
@usovalx:
Some programs (dd, tar) actually intercept signal sent by ^T and print some extra information.

We can do likewise within our own shell scripts, by simply trapping the signal and adding some code... such as:
ShowInfo ()
{
	# say (or do) whatever "INFO" means to your script
	printf '%s: hello world.\n' "$(basename "$0")"
}

#

trap -- 'ShowInfo >&2'	INFO

-HI-


[ Reply to This | # ]