RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Help with .sh scripts and global variables

    Scheduled Pinned Locked Moved Help and Support
    variablescriptinghelp me please
    3 Posts 2 Posters 325 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      red37
      last edited by

      Hi, first post so i hope it wont be to bad. I couldnt find answers anywhere i looked online and im fairly new to linux and retropie.

      So im using mpg123 for background audio and it works fine, stops when games launch and starts when they close. I made 2 scripts in my desktop roms folder where i have my .sh to start the desktop and they work fine, one stops the music and the other will start/restart the music.

      I want to be able to switch the sourse of my music from folder to folder so I have it set an env variable at boot that points to my music selection and i changed my .sh files to use the variable. That all works fine, my problem is.

      I made another .sh file to set that variable to point at my other music folder. I run the script but my variable doesn't update. I read online that its setting a local variable so I tried using the export command and it still doesnt update. How could i get my .sh files to set environment variables globaly?

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        You should post your scripts - on pastebin.com - and indicate how you launch each one. Without the source, it's difficult to give any advice.

        R 1 Reply Last reply Reply Quote 0
        • R
          red37 @mitu
          last edited by

          @mitu thank you for your reply, sorry i was distracted for a few days. I didnt figure out how to make variables work but i was able to make a txt file that i could read/write as a varriable so im good now.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.