From d15a78517dfa18948aaf9ae91b19cdc2de5df998 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Fri, 2 Apr 2021 13:36:51 -0500 Subject: Cleanup information messages for chapater 7 backup and cleanup and change from echo to printf. --- chapter7/backup.sh | 8 ++++---- chapter7/cleanup.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'chapter7') diff --git a/chapter7/backup.sh b/chapter7/backup.sh index 2aac08e..a6abb86 100644 --- a/chapter7/backup.sh +++ b/chapter7/backup.sh @@ -4,19 +4,19 @@ file="${LFS_VER}-ch7-backup.tar.xz" directories=(bin dev etc lib lib64 proc run sbin sys tools usr var) if [ -f "${LFS}/sources/chapter7/backup" ]; then - echo -e " ${IGRN}Backup found. Remove manually to backup again.${RST}" + printf "%b" " ${IGRN}Backup previously completed${RST}\n" else - echo -ne "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " + printf "%b" "${GRN}Backing up ${YLW}${LFS}${GRN} to ${YLW}${file}${RST}... " pushd "${LFS}" > /dev/null || exit 1 sudo XZ_OPTS="-T${NUMPROCS} -e" tar cJpf "${HOME}"/"${file}" "${directories[@]}" >/dev/null 2>&1 & pid=$! spinner "$pid" "${SPINNER}" retval=$? if [ "${retval}" -ne 0 ]; then - echo -e "${IRED}FAILED!${RST}\n" + printf "%b" "${IRED}FAILED!${RST}\n" exit "${retval}" else - echo -e "${IGRN}OK${RST}\n" + printf "%b" "${IGRN}OK${RST}\n" fi popd > /dev/null || exit 1 diff --git a/chapter7/cleanup.sh b/chapter7/cleanup.sh index 60a934f..0a5ec86 100644 --- a/chapter7/cleanup.sh +++ b/chapter7/cleanup.sh @@ -1,10 +1,10 @@ #!/bin/bash if [ -f "${LFS}/sources/chapter7/cleanup" ]; then - echo -e " ${IGRN}Cleanup already performed.${RST}" + printf "%b" " ${IGRN}Cleanup already performed${RST}\n" else - echo -ne "${GRN}Cleaning up ${YLW}${LFS}${RST}... " + printf "%b" "${GRN}Cleaning up ${YLW}${LFS}${RST}... " sudo find "${LFS}"/usr/lib -name \*.la -delete >/dev/null 2>&1 sudo find "${LFS}"/usr/libexec -name \*.la -delete >/dev/null 2>&1 @@ -18,6 +18,6 @@ else sudo strip --strip-unneeded "${LFS}"/usr/sbin/* >/dev/null 2>&1 sudo strip --strip-unneeded "${LFS}"/tools/bin/* >/dev/null 2>&1 - echo -e "${IGRN}OK${RST}\n" + printf "%b" "${IGRN}OK${RST}\n" touch "${LFS}"/sources/chapter7/cleanup >/dev/null 2>&1 fi -- cgit v1.2.3-54-g00ecf