Hi
I have a bash script that I need to run both interactivly and non-interactivly (ie via crond or using '&').
This script echo's my lovely junk to the terminal if run interactivly, or to a file if run via crond.
I use: (Which works fine!!)
if [ -z $(tty) ]; then
exec > the_file 2>&1...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.