Skip to content

improve test_fail.sh - #862

Merged
HowardHinnant merged 2 commits into
HowardHinnant:masterfrom
fkobi:patch-1
Jan 9, 2025
Merged

HowardHinnant merged 2 commits into
HowardHinnant:masterfrom
fkobi:patch-1

Conversation

@fkobi

@fkobi fkobi commented Jan 9, 2025

Copy link
Copy Markdown
Contributor

The first change is a bugfix -- bash is not available on any system and the path to it is not always the same.
Calling /usr/bin/env bash is a good fix for that, but the script is not using any bash-specific stuff so I have made it call /bin/sh which is a standard location for the POSIX sh.

In the second commit I have simplified the code while keeping the functionality:

$ ./test_fail.sh true && echo ok || echo bad
true
ok
$ ./test_fail.sh false && echo ok || echo bad
false
bad

fkobi added 2 commits January 9, 2025 10:02
This is a simple shell script using no bash functionalty.

Closes: #854
the default `exit` value is 0 so we do not need to explicitly call it
@HowardHinnant
HowardHinnant merged commit 8a1102f into HowardHinnant:master Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants