From 27d96690175f448dd0e8360faeaf1c1cecd5a12a Mon Sep 17 00:00:00 2001 From: Elmar Pruesse Date: Wed, 2 Nov 2022 13:11:54 -0600 Subject: [PATCH] Avoid expr substr in spades_compile.sh `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. --- assembler/spades_compile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assembler/spades_compile.sh b/assembler/spades_compile.sh index 8d82c7564..18f0f0637 100755 --- a/assembler/spades_compile.sh +++ b/assembler/spades_compile.sh @@ -36,10 +36,10 @@ check_whether_OPTARG_is_an_integer() { } # return the argument first character -str_head() { echo "$(expr substr "$1" 1 1)"; } +str_head() { echo "${1::1}"; } # return the argument without the first character -str_tail() { echo "$(expr substr "$1" 2 $((${#1}-1)))"; } +str_tail() { echo "${1:1}"; } print_help() { echo