Interactive Drush Script I would like to write an interactive Drush script that potentially makes a change to all pages of a website.  Let's say we would would like to change "Foo" to "Baz" on each page.  We want to review each changed page before it is saved.  The code would look something like this:

foreach(website as node) {
  if node-&gt;body-&gt;value contains "Foo" {
    change "Foo" to "Baz" and display the changed version of body for the user
    Prompt User: Commit change? Yes or No
    if "Yes", save the node
    }
}


It appears Drush is buffering output so that I can not interact with the user in this way.  Is this possible?
Drush has built-in functions to handle I/O. 

If you're using Drush &lt;9.x, there's the procedural drush_confirm() that will prompt a user for a response to a given message. If you're using 9.x+, any custom command class extending the DrushCommands class will have access to the $this-&gt;io()-&gt;confirm method which does the same thing with Symphony's CLI components.

See the latest Drush docs for more info on I/O.