I’m just starting on Ubuntu, trying to figure things out. I’m a little confused.
Short version of my questions:
A) Making my bash scripts executable doesn’t seem to be working reliably. It just inexplicably won’t work sometimes, even when using the same steps on identical scripts in the same directory.
B) When I can get the executability to work, sometimes two identical scripts seem to behave differently. One does its job as intended, the other throws a “Command not found” Error notification, despite both being the same scripts with different names in the same directory.
My steps for making scripts executable:
Right click on the file and check Properties>Permissions>”Allow executing files as program.” (This doesn’t seem to do anything, but I do it anyway. Whenever I try to execute the script after this step, nothing happens.)
Run “chmod +x ” in the terminal.
I have got this to work on two different scripts, but on no others. I have no idea what I’m doing wrong. When executability isn’t working, I can run the script through the terminal, and it works just fine.
Here’s an example of the script I’m trying to run:
cd Desktop/Projects/Zemmings V3/NeoLemmix_V12.12.1
This script works, and is executable. Now I want to duplicate it and change the paths and programs for different windows apps.
I copy and paste the file, change the name, run through the executability steps above, double click it, and I get an error saying “Command not found”. However, this is before changing the script, so it should do exactly the same thing as the original. Despite having identical contents, it give an error while the original still works.
So, if anyone has an answer or tip for me, let me know.
——-(Summary of questions)————
Why does checking Properties>Permissions>”Allow executing files as program.” on a file seem to do nothing?
Why doesn’t “chmod +x ” work sometimes?
Why are two identical scripts in the same directory behaving differently?