From a9998650875c122d505c3046b23dc5f8590857f7 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Tue, 23 Mar 2021 14:04:35 -0500 Subject: Use printf instead of echo. --- lfs.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'lfs.sh') diff --git a/lfs.sh b/lfs.sh index db1c2dd..c154c19 100755 --- a/lfs.sh +++ b/lfs.sh @@ -2,48 +2,48 @@ clear -echo "Sourcing colors..." +printf "%b" "Sourcing colors...\n" # Colors defined for text source colors.sh -echo "Sourcing environment variables..." +printf "%b" "Sourcing environment variables...\n" # LFS build environment settings source env.sh -echo "Sourcing spinner..." +printf "%b" "Sourcing spinner...\n" # Spinner function (returns an exit value) source spinner.sh # Version check script #source versioncheck.sh -echo -e "\n\n\n${CYN}BUILDING ${YLW}${LFS_VER} $(uname -m)${CYN} at \ +printf "%b" "\n\n\n${CYN}BUILDING ${YLW}${LFS_VER} $(uname -m)${CYN} at \ ${PRP}${LFS}${CYN} on ${PRP}${LFS_DISK}${LFS_PART}${RST}\n\n\n" # Continue or Abort -echo -e "${IGRN}CONTINUE ${IWHTB}(C)${RST} / ${IRED}ABORT ${IWHTB}(OTHER)${RST}" +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 - echo -e "\b${IWHT}Build is ${IGRN}CONTINUING${RST}" + printf "%b" "\b${IWHT}Build is ${IGRN}CONTINUING${RST}\n" else - echo -e "\b${IWHT}Build ${IRED}ABORTED!" + printf "%b" "\b${IWHT}Build ${IRED}ABORTED!\n" exit 0 fi else - echo -e "\b${IWHT}Selection ${IRED}FAILURE!${RST}" + printf "%b" "\b${IWHT}Selection ${IRED}FAILURE!${RST}\n" exit 1 fi -echo -e "${GRN}Creating LFS directory at ${YLW}${LFS}${GRN} if it does not exist...${RST}" +printf "%b" "${GRN}Creating LFS directory at ${YLW}${LFS}${GRN} if it does not exist...${RST}\n" # Create LFS directory if it doesn't exist [[ -d /mnt/lfs ]] || sudo mkdir "${LFS}" # Setup partition, filesystem, format and mount if # LFS filesystem is not previously mounted if ! grep -q "${LFS}" /proc/mounts; then - echo -e "${GRN}Setting up partition on ${YLW}${LFS_DISK} ${GRN}\ + printf "%b" "${GRN}Setting up partition on ${YLW}${LFS_DISK} ${GRN}\ with ${YLW}ext4${GRN} filesystem at ${YLW}${LFS_DISK}${LFS_ROOT} ${GRN}\ -and mounting at ${YLW}${LFS}${RST}..." +and mounting at ${YLW}${LFS}${RST}...\n" source setupdisk.sh "${LFS_DISK}" "${LFS_PART}" sudo mount "${LFS_DISK}${LFS_PART}" "${LFS}" @@ -68,7 +68,7 @@ esac #sudo groupadd lfs #sudo useradd -s /bin/bash -g lfs -m -k /dev/null lfs -#echo -e "${LFS_PWD}\n${LFS_PWD}\n" | sudo passwd lfs +#printf "%b" "${LFS_PWD}\n${LFS_PWD}\n" | sudo passwd lfs # Copy scripts and csv files to LFS sources target cp -rf ./*.sh chapter* ./*.csv "${LFS}/sources" @@ -104,9 +104,9 @@ done chmod ugo+x preparechroot.sh chmod ugo+x insidechroot.sh -echo -e "${CYN}PREPARING CHROOT ENVIRONMENT...${RST}" +printf "%b" "${CYN}PREPARING CHROOT ENVIRONMENT...${RST}\n" sudo ./preparechroot.sh "${LFS}" -echo -e "${CYN}ENTERING CHROOT ENVIRONMENT...${RST}" +printf "%b" "${CYN}ENTERING CHROOT ENVIRONMENT...${RST}\n" sleep 3 sudo chroot "${LFS}" /usr/bin/env \ -- cgit v1.2.3-54-g00ecf