From 3c34167115e653f63e8e4036e3c03550ca296bc6 Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Wed, 19 Feb 2020 13:38:30 +0300 Subject: modified message functions and removed out() --- mkrootfs.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/mkrootfs.sh b/mkrootfs.sh index 0fe3074..eb80f9c 100755 --- a/mkrootfs.sh +++ b/mkrootfs.sh @@ -4,11 +4,10 @@ # Functions -out() { printf "%s\\n" "$@" ;} -msg() { printf "\033[1;35m=>\033[m $1\\n" ;} +msg() { printf '\033[1;35m=>\033[m %s\n' "$1" ;} error() { msg "\033[1;31mERROR: \033[m$1" ;} >&2 die() { error "$1"; exit 1 ;} -ask() { printf "\033[1;33m== $1 ==\\n(y/N) "; read ans; case "$ans" in [Yy]*) return 0 ;; *) return 1 ;; esac ;} +ask() { printf '\033[1;33m== %s ==\\n(y/N) ' "$1" ; read ans; case "$ans" in [Yy]*) return 0 ;; *) return 1 ;; esac ;} # Exit if the user is not root @@ -29,22 +28,23 @@ BASEDIR="$PWD" # Print variables from the configuration file -out \ -"Here are the configuration values:" \ -"" \ -"MNTDIR = $MNTDIR" \ -"" \ -"Build Options" \ -"CFLAGS = $CFLAGS" \ -"CXXFLAGS = $CXXFLAGS" \ -"MAKEFLAGS = $MAKEFLAGS" \ -"" \ -"Repository and package options" \ -"" \ -"REPO = $REPO" \ -"REPOSITORY PATH = $HOST_REPO_PATH" \ -"PKGS = $PKGS" +cat <