diff --git a/CHANGELOG.md b/CHANGELOG.md index b670108c..ed98ab09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Release history for s390-tools (MIT version) Bug Fixes: - dbginfo.sh: save dbginfo.sh version to dbginfo.log + - dbginfo.sh: ensure compatibility with /bin/dash shell * __v2.23.0 (2022-08-18)__ diff --git a/scripts/dbginfo.sh b/scripts/dbginfo.sh index 5705afa0..c4916393 100755 --- a/scripts/dbginfo.sh +++ b/scripts/dbginfo.sh @@ -1160,8 +1160,9 @@ call_run_command() { local rc=0 local cmd="${1}" local logfile="${2}" - # extract the raw_command and set cmd_type - local raw_cmd=$(echo "${cmd}" | sed -ne 's/^\([^[:space:]]*\).*$/\1/p') + # extract the raw_command and set cmd_type, as some shell might split into + # several lines restrict the cmd echo to the first line only + local raw_cmd=$(echo "${cmd}" | head -1 | sed -ne 's/^\([^[:space:]]*\).*$/\1/p') local cmd_type=$(type ${raw_cmd} | cut -d' ' -sf4,5) echo "#######################################################" >> "${logfile}"