I have a peculiar case here which can be summed up as follows:
I want the entire error/stdout messages to be redirected to a file from my script but also there is one particular line which i want to redirect to terminal and also redirect that to the file.
This is the code:
exec &>test.log
echo "Check if this line is going to test.log"
echo "This should go to stderr" >> /dev/stderr
Now the last line should go to both stderr and test.log.
Can this be achieved somehow in bash ?