Usually if we want to redirect script output to file we simply do

   /etc/create_connection.sh > file.debug.txt  

Or

   /etc/create_connection.sh | tee –a  file.debug.txt  

But What I want is to add /etc/create_connection.sh > file.debug.txt inside the script , but I not sure if it possible and how?

so when I run just

  /etc/create_connection.sh 

I need that all standard output will write to file.debug.txt
so what I need to add in my script in order to do that?

link|improve this question

feedback

1 Answer

up vote 2 down vote accepted

simple write exec > file.debug.txt in the beginning.

link: http://www.faqs.org/docs/abs/HTML/io-redirection.html

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.