[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add non-interactive PROMPT_COMMAND

From: 積丹尼 Dan Jacobson
Subject: Add non-interactive PROMPT_COMMAND
Date: Tue, 10 Mar 2020 22:50:50 +0800

PROMPT_COMMAND=sleep\ 1 is great, it lets us slow down scripts...
but alas only if they are interactive.

One might say: "Sure, instead of
$ bash script
just use
$ sed 's/^/sleep 1; /' script | bash"

But that assumes one command per line, and could easily mangle things.

Instead bash simply needs a PROMPT_COMMAND that works non-interactively too.

Anyway, we could use it to e.g., "check how much oil we have left before
executing each command" etc. tons of great uses!

Maybe even have fullblown PRE and POST commands, that fire before and after 
each command.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]