On 24/09/2023 21:36, Greg Wooledge wrote:
On Sun, Sep 24, 2023 at 12:03:12PM +0200, Michel Verdier wrote:#!/bin/bash errors=$(sudo apt-get install unknown 2>&1 1>/dev/tty) echo "output: $errors" errors=$(sudo apt-get install mirage 2>&1 1>/dev/tty) echo "output: $errors" [...] It waits until I type 'n'Same here.
Thanks for testing. I just tried, and yes it runs OK when the commands are in a script. But type directly into the terminal: errors=$(sudo apt-get install mirage 2>&1 1>/dev/tty) To see the immediate abort. (But not on Debian 11, or after invoking 'sh'.) -- John