Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executed bash thinks that bash-specific syntax is not supported #5

Closed
smspillaz opened this issue Mar 23, 2015 · 1 comment
Closed

Comments

@smspillaz
Copy link
Contributor

Bash specific syntax is not supported in covered scripts, for instance, process substitution, e.g. echo "data" > >(my_function))

The reason for this is that bash's argv[0] is not "bash", but instead the environment variables prepended to it. This causes bash to drop back to sh-compatible mode.

smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 23, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes infertux#5
smspillaz added a commit to smspillaz/bashcov that referenced this issue Mar 24, 2015
Set the BASH_XTRACEFD and PS4 variables explicitly as opposed
to setting them on the command line. If they are the first element
on the command line, argv[0] will not be "bash" and bash will
run in posix-compatible mode, which isn't always the desired
behaviour.

No tests can be provided, as the interaction between BASH_XTRACEFD
and bash-only syntax on BSD is flakey at best, which means that
tests will only pass a part of the time.

Fixes infertux#5
infertux pushed a commit that referenced this issue Mar 24, 2015
Don't set the environment as part of the command line as this
will modify argv[0]. This in turn confuses bash into think that
it is running in /bin/sh compatible mode and not /bin/bash mode.

Added a test to verify that we can get coverage on bashisms.

Fixes #5

Signed-off-by: Cédric Félizard <cedric@felizard.fr>
@infertux
Copy link
Owner

infertux commented May 5, 2015

Should be fixed in ca3c119.

@infertux infertux closed this as completed May 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment