Avoid expr substr in spades_compile.sh#1038
Open
epruesse wants to merge 1 commit intoablab:spades_3.15.5from
Open
Avoid expr substr in spades_compile.sh#1038epruesse wants to merge 1 commit intoablab:spades_3.15.5from
epruesse wants to merge 1 commit intoablab:spades_3.15.5from
Conversation
`expr substr` is not defined in posix and not implemented in MacOS /bin/expr. The much simpler bash substring expansion should be more widely compatible. It does work with MacOS' ancient /bin/bash.
Member
|
Great, thanks! Yes, |
Author
For what it does, yes. Looks like someone had some fun with bash, but didn't know case/esac could do glob matching. Something like below would be easier to read. But then as long as the script works, it's all fine. PASS_THROUGH_OPTS=()
while [[ $# -gt 0 ]]; do
case $1 in
-j|--threads)
THREADS="$2"
shift
shift
;;
*)
PASS_THROUGH_OPTS+=("$1")
shift
;;
esac
doneMostly I was just passing on patch from bioconda I had to add to get spades to even start compiling :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
expr substris not defined in posix and not implemented in MacOS /bin/expr. The much simpler bash substring expansion should be more widely compatible. It does work with MacOS' ancient /bin/bash.