I want to deactivate the output of a program that writes to stdout and fifo at fd = 3. Here is my first attempt:
#!/bin/bash
exec 3> >(cat)
tar -cvzf ha.tgz /dev/fd/1 /dev/fd/3
echo stdout
echo 'fd=3'>&3
exec 3>&-
He created ha.tgz, and its contents were / dev / fd / 1 and / dev / fd / 3. However, when I extract the files, it basically creates symbolic links to / dev / fd / 1 and / dev / fd / 3 (which doesn't work). I was hoping that the files would be just regular files, whose content would be what I did in the script. Is there any way to do this?
User1 source
share