I have a command that I would like to run from a shell script:
LD_PRELOAD='/usr/$LIB/libstdc++.so.6' DISPLAY=:0 steam
This command is necessary to run Steam correctly on my system. If I try to run Steam without this command, the icon appears on the launcher then disappears again, leaving just a process that I have to end in system monitor.
If I cut and paste that command directly into a terminal, it works perfectly. Steam opens and works just fine, and the terminal sits there in the background giving output until Steam is closed again.
If I try to run that command from a shell script, it doesn't work anymore. The same problematic behavior shows up.
Interestingly, if I go into the terminal and type ./Steam.sh
- which is the name of my script - Steam opens correctly.
Steam.sh is located in my home folder, and I run all the commands from my home folder in the terminal, and I have given execute permission to Steam.sh. I have also tried adding &
to the end of the command in the shell script, but that hasn't helped.
Any idea why this command works differently depending on whether it's launched from a shell script or from a terminal? I thought shell scripts were supposed to be basically the same thing as running commands from a terminal.
.desktop
shortcut ? It clearly is working from terminal, so there's something else that you're not telling us – Sergiy Kolodyazhnyy Jan 15 '17 at 10:09export DISPLAY=:0
, same thing withLD_PRELOAD
. Ensure your DISPLAY variable is actually that - justecho $DISPLAY
in terminal. If that doesn't work. Also, consider using/usr/lib/i386-linux-gnu/libstdc++.so.6
or/usr/lib/x86_64-linux-gnu/libstdc++.so.6
instead of the one you have there – Sergiy Kolodyazhnyy Jan 15 '17 at 23:27$DISPLAY
even if I run the script with a mouseclick? – Excrubulent Jan 16 '17 at 21:37