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. --- packageinstall.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packageinstall.sh') diff --git a/packageinstall.sh b/packageinstall.sh index a890ded..c08710a 100644 --- a/packageinstall.sh +++ b/packageinstall.sh @@ -4,7 +4,7 @@ CHAPTER="$1" PACKAGE="$2" if [ -f "${LFS}/sources/chapter${CHAPTER}/${PACKAGE}" ]; then - echo -e "${GRN}Package ${YLW}${PACKAGE} ${GRN}already built and installed for ${YLW}Chapter ${CHAPTER}.${RST}" + printf "%b" "${GRN}Package ${YLW}${PACKAGE} ${GRN}already built and installed for ${YLW}Chapter ${CHAPTER}.${RST}\n" else grep -i "^${PACKAGE}" packages.csv | grep -i -v "\.patch;" | while read -r line; do @@ -17,18 +17,18 @@ else # Remove existing if exists rm -rf "${DIRNAME}" - echo -ne "${IBLU}Extracting ${YLW}${CACHEFILE}... " + printf "%b" "${IBLU}Extracting ${YLW}${CACHEFILE}... " tar xf "${CACHEFILE}" > /dev/null 2>&1 & pid=$! spinner "$pid" retval=$? if [ "$retval" -ne 0 ]; then - echo -e "${GRN}Extraction ${RED}FAILED!${RST}" + printf "%b" "${GRN}Extraction ${RED}FAILED!${RST}\n" return $retval fi pushd "${DIRNAME}" > /dev/null || return 1 - echo -ne "\n${CYN}Compiling ${YLW}${PACKAGE}${RST}... " + printf "%b" "\n${CYN}Compiling ${YLW}${PACKAGE}${RST}... " sleep 5 mkdir -p "${LFS}/sources/log/chapter${CHAPTER}/" @@ -36,11 +36,11 @@ else spinner "$pid" retval=$? if [ "$retval" -ne 0 ]; then - echo -e "\n${GRN}Compiling ${YLW}${PACKAGE} ${RED}FAILED!${RST}" + printf "%b" "${RED}FAILED!${RST}\n" popd > /dev/null || return 1 return $retval else - echo -e "\n${GRN}Done Compiling ${YLW}${PACKAGE}${RST}" + printf "%b" "${GRN}OK${RST}\n" touch "${LFS}"/sources/chapter"${CHAPTER}"/"${PACKAGE}" rm -rf "${LFS}"/sources/"${DIRNAME}" fi -- cgit v1.2.3-54-g00ecf