Timeline for which bash is executing?
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 13, 2016 at 7:14 | comment | added | Peter | @AssenKolov it is posix mode if they used --posix (probably not) or they ran it as "sh" because either it's the user's shell and they didn't set one (which is what source does, ignoring the shebang), or the shebang said it, or they ran "sh somescript" and then maybe that one used source. | |
| Jul 12, 2016 at 16:35 | history | edited | Toby Speight | CC BY-SA 3.0 | Nicely format the blockquotes; minor tidy of text |
| Jul 12, 2016 at 15:49 | comment | added | Assen Kolov | The script is executed as ssh otheruser@localhost " ... source utils.sh ..." what makes it posix style? | |
| Jul 12, 2016 at 11:32 | comment | added | Assen Kolov | kubernetes is more than a few lines of script, have a look at the script I am actually starting that eventually fails in utils.sh: github.com/kubernetes/kubernetes/blob/master/cluster/kube-up.sh Just changing the name of this method will not bring me far. I could either fix the bugs in kubernetes scripts (and get the fix merged to master, or maintain a local copy), or make sure I run them without posix mode. | |
| Jul 12, 2016 at 8:29 | comment | added | Assen Kolov | @Rahul: this issue is the whole reason to investigate how to exclude sh (or POSIX mode, as I understand from @Peter) from running scripts. | |
| Jul 12, 2016 at 8:12 | comment | added | Peter | and if that fails be sure to try fixing what @Rahul pointed out... in the script you are running, they are declaring a function test-build-release() and that's not valid, so try renaming it, eg. to testbuildrelease() in declaration and all calls; or in the sh wrapper script, there's a chance you have to scan for and remove --posix | |
| Jul 12, 2016 at 8:07 | comment | added | Assen Kolov | This sounds genius to me :-) I can't right now but will let you know after I do. | |
| Jul 12, 2016 at 8:04 | comment | added | Rahul | @AssenKolov issue: while "-" used in function is fine for bash, it is not for sh, see line number 32 | |
| Jul 12, 2016 at 8:04 | comment | added | Peter | and I must add that I find this funny...because it's probably just like I said "should not be fully relied on for testing POSIX"... the author of your script probably only tested with bash, not sh, and not the same version of it as you are using. :) | |
| Jul 12, 2016 at 8:03 | vote | accept | Assen Kolov | ||
| Jul 12, 2016 at 8:03 | comment | added | Peter | not sure on a clean solution... but for a dirty hack, remove sh, replace it with a shell script that runs bash "$@"; exit $? | |
| Jul 12, 2016 at 8:01 | comment | added | Assen Kolov | Thank you, that should be the explanation. I am not running this script directly, I am trying to install Kubernetes and after a lot of work it fails with 'not a valid identifier' error. Can I switch Posix off globally? | |
| Jul 12, 2016 at 7:49 | history | answered | Peter | CC BY-SA 3.0 |