Page 6 of 15

Re: Love-Release. Bash script to make it easier.

Posted: Tue Jul 22, 2014 9:59 pm
by Positive07
So its a problem with functions and the parenthesis... try deleting the parenthesis in all of them... just debugging

Re: Love-Release. Bash script to make it easier.

Posted: Wed Jul 23, 2014 3:07 am
by Kookerus
Positive07 wrote:So its a problem with functions and the parenthesis... try deleting the parenthesis in all of them... just debugging
Does it work fine for you? and if so, would you be able to send me a copy of yours, so I can see if it works?

Re: Love-Release. Bash script to make it easier.

Posted: Wed Jul 23, 2014 3:09 am
by Kookerus
I removed all the parentheses, and it threw an error wherever there was the word "function"

Re: Love-Release. Bash script to make it easier.

Posted: Wed Jul 23, 2014 3:17 am
by Kookerus
Found out what was wrong! Because the script has the .sh extension, bash was executing it with /bin/sh instead of /bin/bash.
renaming the file "love-release" fixed the issue

Re: Love-Release. Bash script to make it easier.

Posted: Wed Jul 23, 2014 5:06 pm
by bartbes
It shouldn't, that said the function syntax is either

Code: Select all

functionname()
{
# stuff
}
or

Code: Select all

function functionname
{
# stuff
}
The former being the most portable of the two, too.

Re: Love-Release. Bash script to make it easier.

Posted: Wed Jul 23, 2014 5:49 pm
by Kookerus
I honestly have no clue, but renaming it worked.
For whatever reason, when Ubuntu decides to work for me it's incredibly picky

Re: Love-Release. Bash script to make it easier.

Posted: Wed Jul 23, 2014 7:33 pm
by murks
Not sure this is still true, but at some point I read that ubuntu uses dash (wow, I looked it up and this was a change in Ubuntu 6.10 :)). You may also make sure that the first line in the file is

Code: Select all

#!/usr/bin/env bash
. This should make sure that it is executed with bash, no matter where it is installed. However, I have no idea what ubuntu/gnome will do if you execute it from a file manager that looks at the extension.

Re: Love-Release. Bash script to make it easier.

Posted: Wed Jul 23, 2014 9:50 pm
by Tanner
+1 to `#!/usr/bin/env`

Re: Love-Release. Bash script to make it easier.

Posted: Wed Jul 23, 2014 10:43 pm
by Kookerus
Nope, still doesn't work with the ".sh" extension
I'm using Gnome for my DM, so that might be the problem

Re: Love-Release. Bash script to make it easier.

Posted: Wed Jul 23, 2014 10:50 pm
by murks
Try to run it from the command line. It really seems like stupid gnome executes it with sh because of the .sh extension.