I am trying to write a short script that opens a new terminal window, executes a variable that starts a game server, and logs the output of that new window.
The server sends a huge amount of spam in the console that is entirely useless, so I also wanted to append -q so the window is hidden.
My end goal is to look through the log for "Connected to Steam servers" using grep and report it in the main console. Currently I have the following:
$server="$game_path/server_executable"
gnome-terminal -- $server
Anything I add to gnome-terminal breaks the code. I have tried using gnome-terminal -- "$server 2>&1 | tee server.log"
to the gnome-terminal line but it breaks. I've also tried gnome-terminal -- "@server >> server.log"
but that fails too. I can't figure out the answer to get the new shell running the server command and exporting the output to a log file.
Running on Debian 12.