Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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