0

I am using Ubuntu 16.0.4 and Steam need a workaround:

    LD_PRELOAD='/usr/$LIB/libstdc++.so.6' steam

It gets annoying to put it in the terminal every time I play. Is there a way to put the command in a text document, and make that document execute the command when I click on the file? Thanks.

  • what editor are you using? – glenn jackman May 17 '16 at 19:42
5
gedit script.sh

type your command in the file

chmod +x script.sh

or you can use an alias if you usually open steam by command line

open .bashrc with your text editor

gedit ~/.bashrc

add this line in the end

alias steam='"LD_PRELOAD=/usr/$LIB/libstdc++.so.6" steam'

The above idea to make an alias is a very good one, and can be built into your desktop launcher by editing the ~/.profile file, which is functionally similar to ~/.bashrc. Open ~/.profile in gedit and add the same alias steam='"LD_PRELOAD=/usr/$LIB/libstdc++.so.6" steam' to it, and it will automatically execute that way when you launch Steam from a desktop icon, or your dock/launcher/whatever.

  • 1
    i really like the idea of an alias. I think, though, that the command should be alias steam='LD_PRELOAD="/usr/\$LIB/libstdc++.so.6" steam' – user448115 May 17 '16 at 23:35
1

To add a different point of view to the previous answer, you can always use the reverse-i-search in the terminal, which search through all the commands you have executed.

To use it, press CTRL+R and try to type same characters to identify your previous command. For example, CTRL+R and then writing steam should give you the command you want. Then, just press Enter to execute it.

You can also add a tag to the command to identify it. For example, you can run the program using

LD_PRELOAD='/usr/$LIB/libstdc++.so.6' steam #mytag

and then CTRL+R, then #mytag should give you this exact command.


If you still want to use a script, maybe the most immediate way is to execute

echo "LD_PRELOAD='/usr/$LIB/libstdc++.so.6' steam" > steam_script.sh
chmod u+x steam_script.sh

and then launch the file using ./steam_script.sh from the directory in which you have created the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.