title: Bash: printing program output to file, not on screen
body: <p>I have a bash file to spin a few servers for me. I want all the program std output to be generated by the running servers to be saved in the file, and not printed by bash on the screen. This is how I wrote my bash file:</p>
  
  <pre><code>#!bin/sh
  
  rm -rf database.db
  
  go run server.go -typ=server -id=Server1 -host=localhost -port=9998 | tee logs/Server1.log &amp;
  go run server.go -typ=server -id=Server2 -host=localhost -port=9999 | tee logs/Server2.log &amp;
  go run server.go -typ=server -id=Server3 -host=localhost -port=9998 | tee logs/Server3.log ;
  </code></pre>
  
  <p>When i run <code>bash my_script.sh</code> the output is indeed written to .log files, however the same output is still printed on the screen. How I can fix it?</p>