0

How can you change where output of a command goes throughout its lifetime?

Below I'd hoped arecord's output would start going to file2 when the script received a USR2 signal but it keeps to file1.

#!/usr/bin/env sh
f=file1
trap f=file1 USR1
trap f=file2 USR2
arecord > "$f"
aaa
  • 217

0 Answers0