I have the following script:
{
...
many commands and printing
...
if something goes wrong I do exit 1
} 2>&1 | tee test.log
But the problem is that the {}
block is exiting and not the whole script.
How can I make the whole script exit?