Sample Header Ad - 728x90

Confusing results of eval + sed combination

0 votes
2 answers
136 views
I run a game from steam which starts with the game companies launcher app where I have to click another button to start the actual game. The game launcher is very slow, contains needless advertising, which I should not be forced to experience as I paid for the game in it's entirety, it is not a free online game *paid for by advertising*, and it sends my telemetry to different servers around the world! Someone provided some simple code in a community guide to bypass the launcher but I cannot get it to work for reasons that make no sense to me. Their simple code is to put this command in steam's properties for the game which works for them and other users eval $( echo “%command%” | sed -E “s#Launcher/dowser.exe#Cities2.exe#g” ) But nothing happens when I start the game in steam, it just exits after 30 seconds or so. So I added **tee** to the command to see what sed ouputs, like this eval $( echo “%command%” | sed -E “s#Launcher/dowser.exe#Cities2.exe#g” | tee ~/foot.txt) And foo.txt is empty, which makes no sense because if I run this command eval $( echo “%command%” | foo.bash ) Which is this script #/bin/bash echo "$*" > ~/foo.txt Then foo.txt has the expected command line received by bash on STDIN that sed should be receiving. So then I ran the same sed command with the --debug switch and get this output in a log SED PROGRAM: s/Launcher\/dowser.exe/Cities2.exe/g INPUT: 'STDIN' line 1 PATTERN: /home/user/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=949230 -- /home/user/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/user/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/user/.local/share/Steam/steamapps/common/Proton 8.0'/proton waitforexitandrun '/home/user/.local/share/Steam/steamapps/common/Cities Skylines II/Launcher/dowser.exe' COMMAND: s/Launcher\/dowser.exe/Cities2.exe/g MATCHED REGEX REGISTERS regex = 409-428 'Launcher/dowser.exe' PATTERN: /home/user/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=949230 -- /home/user/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/user/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/user/.local/share/Steam/steamapps/common/Proton 8.0'/proton waitforexitandrun '/home/user/.local/share/Steam/steamapps/common/Cities Skylines II/Cities2.exe' END-OF-CYCLE: /home/user/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=949230 -- /home/user/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/user/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/user/.local/share/Steam/steamapps/common/Proton 8.0'/proton waitforexitandrun '/home/user/.local/share/Steam/steamapps/common/Cities Skylines II/Cities2.exe' So sed is receiving the expected data from steam on STDIN, and the sed commandline script is producing the expected result, but inexplicably eval is not recieving the sed output or not executing it. Then just to see what happens, I ran the same command again but chained the sed output from the debug log after the sed command, so the result and output from sed would be thrown away, and the appended command would be run, like this eval $( echo “%command%” | sed -E “s#Launcher/dowser.exe#Cities2.exe#g” & /home/user/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=949230 -- /home/user/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/user/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/user/.local/share/Steam/steamapps/common/Proton 8.0'/proton waitforexitandrun '/home/user/.local/share/Steam/steamapps/common/Cities Skylines II/Cities2.exe') And the game successfully runs without the launcher!!! I don't get it, why is eval not executing the sed output as the command, but does execute the command line that sed apparently does output when I chain it after the sed command? The only downside to that execution was that steam does not recognize that the game has closed when I exit it, but I could live with that. I am running on Ubuntu 23.10, using steam in X
Asked by nobody special (103 rep)
Dec 11, 2023, 04:24 PM
Last activity: Jan 28, 2024, 03:16 PM