Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16015

Add non-interactive PROMPT_COMMAND

From 積丹尼 Dan Jacobson <jidanni@jidanni.org>
Newsgroups gnu.bash.bug
Subject Add non-interactive PROMPT_COMMAND
Date 2020-03-10 22:50 +0800
Message-ID <mailman.2447.1583898072.2412.bug-bash@gnu.org> (permalink)
References <87wo7sgt6d.8.fsf@jidanni.org>

Show all headers | View raw


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.

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Add non-interactive PROMPT_COMMAND 積丹尼 Dan Jacobson <jidanni@jidanni.org> - 2020-03-10 22:50 +0800

csiph-web