Do not rely on bashisms and behaviour undefined by the POSIX specification. Part 2

Signed-off-by: Ferass 'Vitali64' EL HAFIDI <vitali64pmemail@protonmail.com>
This commit is contained in:
Ferass 'Vitali64' EL HAFIDI
2022-12-28 19:29:18 +01:00
committed by Leah Rowe
parent f787044642
commit 7f5dfebf7d
14 changed files with 42 additions and 37 deletions
+4 -3
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
# SPDX-FileCopyrightText: 2022 Caleb La Grange <thonkpeasant@protonmail.com>
# SPDX-FileCopyrightText: 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# SPDX-License-Identifier: GPL-3.0-only
Fail(){
@@ -53,10 +54,10 @@ Detect_board(){
filename=$(basename ${rom})
case ${filename} in
grub_*)
board=$(cut -d '_' -f2-3 <<<${filename})
board=$(echo "${filename}" | cut -d '_' -f2-3)
;;
seabios_withgrub_*)
board=$(cut -d '_' -f3-4 <<<${filename})
board=$(echo "${filename}" | cut -d '_' -f3-4)
;;
*)
return 1