From 315ce2397efab99a8a15cd2bb73367b00f178418 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Fri, 2 Apr 2021 11:08:30 -0500 Subject: Use if [[ ... ]] instead of [ ... ] and change retval check in setupdisk when checking exit code when creating partition. --- lfs.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lfs.sh') diff --git a/lfs.sh b/lfs.sh index 708328a..c2bcc07 100755 --- a/lfs.sh +++ b/lfs.sh @@ -33,7 +33,7 @@ before continuing.${RST}\n\n\n" # Continue or Abort printf "%b" "${IGRN}CONTINUE ${IWHTB}(C)${RST} / ${IRED}ABORT ${IWHTB}(OTHER)${RST}\n" if read -r -n 1 contabort; then - if [ "$contabort" == "C" ] || [ "$contabort" == "c" ]; then + if [[ "$contabort" == "C" ]] || [[ "$contabort" == "c" ]]; then printf "%b" "\b${IWHT}Build is ${IGRN}CONTINUING${RST}\n\n" else printf "%b" "\b${IWHT}Build ${IRED}ABORTED!\n\n" @@ -94,7 +94,7 @@ printf "%b" "\n${IWHT}============ ${IGRN}Downloading source files and patches \ ${IWHT}============${RST}\n" source download.sh retval=$? -if [ "$retval" -ne 0 ]; then +if [[ "$retval" -ne 0 ]]; then exit 1 fi @@ -104,7 +104,7 @@ printf "%b" "\n${IWHT}============ ${IGRN}Building ${IYLW}Chapter 5${IWHT} \ for package in binutils gcc linux-api-headers glibc libstdc++; do source packageinstall.sh 5 $package retval=$? - if [ "$retval" -ne 0 ]; then + if [[ "$retval" -ne 0 ]]; then exit 1 fi done @@ -115,7 +115,7 @@ printf "%b" "\n${IWHT}============ ${IGRN}Building ${IYLW}Chapter 6${IWHT} \ for package in m4 ncurses bash coreutils diffutils file findutils gawk grep gzip make patch sed tar xz binutils gcc; do source packageinstall.sh 6 $package retval=$? - if [ "$retval" -ne 0 ]; then + if [[ "$retval" -ne 0 ]]; then exit 1 fi done -- cgit v1.2.3-54-g00ecf