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

    Creating new script file issues.

    Scheduled Pinned Locked Moved Help and Support
    bashscripts
    7 Posts 2 Posters 802 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.
    • P
      polygaryd
      last edited by polygaryd

      My two scripts I just made have the correct shebang string and executable permissions set and still give the same error:

      filename.sh: bin/bash: bad interpreter: No such file or directory

      I made these txt files with .sh file extention.

      I try to run them from the folder they are in using ./filename.sh

      I created the files in leafpad in lxde originally

      I have tried copying the shebang from other known good executable script files with the same result.

      I have made sure all the permissions are identical to those of other known good executable script files with same result.

      The only way I can get new script files to work in any capacity is to make a copy of a working script file, rename it, delete and replace the contents with my new script contents. Then it works just fine in terminal in less or when you hit f4 and drop to command line out of emulationstation.

      Pi3b+ and pi4b
      Canakit pay
      Image made from retropie.org
      Retropie version is from may 2021. Can't remember the versions of I'd list them.

      What is the deal with not being able to create an sh file from scratch and run it in leafpad in lxde in retropie on a pi device? What am I doing wrong?

      This just happened to me again today btw. Smh. So frustrated.

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

        @polygaryd said in Creating new script file issues.:

        What is the deal with not being able to create an sh file from scratch and run it in leafpad in lxde in retropie on a pi device? What am I doing wrong?

        Posting the script and the error you're getting might help diagnosing the issue.

        P 1 Reply Last reply Reply Quote 0
        • P
          polygaryd @mitu
          last edited by

          @mitu I posted the error above in my original post.

          The script contents could be empty besides shebang #!/bin/bash and get the error. It could have one mkdir command that works if you do it in the terminal to know it works first and still produce The error. The contents of the script for this particular error doesn't matter.

          Bash won't run the file unless the contents are put into another already functioning script file. It makes no sense because I clear out the entire contents of the fully functional script file and replace with the contents of the script file I created (which produces the error) and the file runs my commands without issue.
          I change the file name to my new script file name after copying the contents over and deleting the new non working script file.
          So file name is the same
          Folder the file resides in and I'm executing from is the same
          Contents are identical
          Permissions are identical
          How I run the file is identical
          The file created in leafpad won't work and a script from anywhere else say the hexen2 install script downloaded from posts in this forum work fine(that is an example I use because it happens to be the file I used tonight to duplicate and replace the contents with my script content)

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

            @polygaryd said in Creating new script file issues.:

            @mitu I posted the error above in my original post.

            Upload the script file somewhere (not copy & paste in the forum). Make sure the file hasn't got Windows/DOS line endings.

            P 1 Reply Last reply Reply Quote 0
            • P
              polygaryd @mitu
              last edited by

              @mitu said in Creating new script file issues.:

              @polygaryd said in Creating new script file issues.:

              @mitu I posted the error above in my original post.

              Upload the script file somewhere (not copy & paste in the forum). Make sure the file hasn't got Windows/DOS line endings.

              @mitu. What do you mean windows/dos line endings? Like file extension .txt or .doc .docx etc?

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

                @polygaryd said in Creating new script file issues.:

                What do you mean windows/dos line endings? Like file extension .txt or .doc .docx etc?

                No, I mean this.

                P 1 Reply Last reply Reply Quote 0
                • P
                  polygaryd @mitu
                  last edited by

                  @mitu since I copied the script contents into a working script file after clearing the previous contents, I have no non working scripts now. I have to recreate this issue to even be able to upload a script. I'll work on it this week and upload it the scripts.

                  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.