Creating new script file issues.
-
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.
-
@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.
-
@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) -
@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 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?
-
@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.
-
@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.
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.