Reputation: 1318
So I've got a script that runs test cases on another script. I'm trying to redirect stderr while running the test cases. The part that is giving me problems is the read command:
within script1:
read -p "Delete $file? (y/n) " input
within testscript:
$script $opts $file 2>/dev/null
The read calls from script1 get redirected as well.
Upvotes: 5
Views: 1489
Reputation: 361585
Redirect the prompt to stdout.
read -p "Delete $file? (y/n) " input 2>&1
Upvotes: 5