PART 1 Ok so i'm using Mac and I started out with a file called...
In Terminal I ran this file in its directory by typing...
That works perfectly, but then I did some research about bash vs sh and found that I could have also written it like this...
That also worked. I did some more research and an idea came to mind, that since bash is the "newer" way to do things, I thought I would try to rename
myFile.bash to see if it would still run in terminal if I typed this...
And it worked perfectly! But now I'm wondering if there is a reason that the file was originally named
myFile.sh instead of
So, is it bad that I renamed it to
myFile.bash instead of
myFile.sh? Or is it totally fine??
(i'm new to Terminal commands)
Another question: How would I make this "myFile.sh" executable? This is the contents of myFile.sh below:
#!/bin/bash python runtime/recompile.py "$@"
NOTE: I did some research and tried renaming myFile.sh to myFile.command which should make it executable when I open the file, but it didn't work and I got this error in Terminal:
python: can't open file 'runtime/recompile.py': [Errno 2] No such file or directory
So my questions really are:
a) How do I make myFile.sh executable in Terminal? b) Why didn't renaming myFile.sh to myFile.command?
Any help appreciated.