I have a script (ksh, Linux) which is about 500 lines and this is only a small requirement. Below is an example of my requirement.
FunctionThis(){
echo "You are in this. Goes to log"
}
FunctionThat(){
echo "You are in That. Goes to log"
}
FunctionScreen(){
echo "You are in Screen. Goes to screen."
echo "Press ^c to exit"
sleep 60
}
################
# Main
################
exec > Outlog1.txt 2>&1
FunctionThis
FunctionThat
exec > > 2>&1
FunctionScreen
- Now all the outputs are going to .log file.
- I want "FunctionScreen" output to be on the screen.
Not into the log file.
That is, I thought
exec > > 2>&1
will disable writing to log file.
Can you help me please?