0

I have application written in Go language and it runs in screen (I do not think problem relates to Go language. I believe it uses STDOUT and STDERR)

screen -S log_server -d -m go run log_server.go 2 > err3.txt 1 > std3.txt

When it crashes I get error written in screen not in err3.txt or std3.txt

screen does not scroll and does not allow me to read full error.

std3.txt works properly err3.txt has size 0 and error is printed in screen (I can see last 20 or 30 lines) App crashes once per 3 or 5 days.

Max
  • 133
  • 1
  • 7

1 Answers1

7

Not all spaces are permissible. Try instead

screen -S log_server -d -m go run log_server.go 2> err3.txt 1> std3.txt
MadHatter
  • 79,770
  • 20
  • 184
  • 232
  • Thank You. I ran command as you advised. `std3.txt` worked for me. So I thought these spaces are Ok. – Max Apr 21 '13 at 09:16
  • 1
    Nope. But `> std3.txt` is a lawful form of `1> std3.txt`, so redirecting STDOUT was working, and the rest of the stuff was just creating errors or being ignored as extra arguments to the main command. By the way, and forgive me for saying this, but feel free to ACCEPT the answer if you're happy with it. – MadHatter Apr 21 '13 at 09:53
  • I planned to mark answer accepted once process will crash and I will get error in file. But it is not a problem. Thank You for you response. I am happy with your answer. It is accepted. – Max Apr 21 '13 at 20:16