tazinst rev 12

Tiny edits
author Dominique Corbex <domcox@slitaz.org>
date Sat Aug 17 21:44:53 2013 +0200 (2013-08-17)
parents d3ae670696d2
children 7e0be1e36271
files COPYING README tazinst
line diff
     1.1 --- a/COPYING	Sat May 04 18:13:40 2013 +0000
     1.2 +++ b/COPYING	Sat Aug 17 21:44:53 2013 +0200
     1.3 @@ -8,17 +8,17 @@
     1.4  Français
     1.5  --------
     1.6  
     1.7 -Tazinst est un logiciel libre ; vous pouvez le redistribuer et/ou le 
     1.8 -modifier conformément aux dispositions de la Licence Publique Générale GNU, 
     1.9 -telle que publiée par la Free Software Foundation ; version 3 de la 
    1.10 +Tazinst est un logiciel libre ; vous pouvez le redistribuer et/ou le
    1.11 +modifier conformément aux dispositions de la Licence Publique Générale GNU,
    1.12 +telle que publiée par la Free Software Foundation ; version 3 de la
    1.13  licence, ou encore (à votre choix) toute version ultérieure.
    1.14  
    1.15 -Tazinst est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE 
    1.16 -GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou 
    1.17 -D'ADAPTATION À UN OBJET PARTICULIER. Pour plus de détails, voir la Licence 
    1.18 +Tazinst est distribué dans l'espoir qu'il sera utile, mais SANS AUCUNE
    1.19 +GARANTIE ; sans même la garantie implicite de COMMERCIALISATION ou
    1.20 +D'ADAPTATION À UN OBJET PARTICULIER. Pour plus de détails, voir la Licence
    1.21  Publique Générale GNU.
    1.22  
    1.23 -Un exemplaire de la Licence Publique Générale GNU doit être fourni avec 
    1.24 +Un exemplaire de la Licence Publique Générale GNU doit être fourni avec
    1.25  Tazinst si ce n'est pas le cas, écrivez à la Free Software Foundation
    1.26  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.27  
    1.28 @@ -33,7 +33,7 @@
    1.29  
    1.30  Tazinst is distributed in the hope that it will be useful, but WITHOUT
    1.31  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    1.32 -FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
    1.33 +FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    1.34  more details.
    1.35  
    1.36  You should have received a copy of the GNU General Public License
     2.1 --- a/README	Sat May 04 18:13:40 2013 +0000
     2.2 +++ b/README	Sat Aug 17 21:44:53 2013 +0200
     2.3 @@ -1,14 +1,14 @@
     2.4  SliTaz Installer
     2.5  ================================================================================
     2.6  
     2.7 -Tazinst is the SliTaz installer written entirely in SHell script and usable from 
     2.8 -the cmdline without dialog or any other gui-like interface! This installer
     2.9 +Tazinst is the SliTaz installer written entirely in SHell script and usable
    2.10 +from the cmdline without dialog or any other gui-like interface! This installer
    2.11  is able to perform an installation automatically based on a simple config file
    2.12  with clear variables such as: INST_TYPE="iso", TGT_PARTITION="/dev/hda1".
    2.13  
    2.14 -With this way, it allows developers to create a different kind of frontend: 
    2.15 -Dialog, CGI/web. Two frontends are included: slitaz-installer, a ncurses frontend,
    2.16 -and a CGI/web frontend.
    2.17 +With this way, it allows developers to create a different kind of frontend:
    2.18 +Dialog, CGI/web. Two frontends are included: slitaz-installer, a ncurses
    2.19 +frontend, and a CGI/web frontend.
    2.20  
    2.21  
    2.22  i18n
    2.23 @@ -16,8 +16,8 @@
    2.24  Tazinst has been coded from the beginning with gettext support. Please
    2.25  forget 'echo' and use gettext, but remember that gettext "" is equivalent
    2.26  to echo -n. All translations go in the po/ folder.
    2.27 - 
    2.28 -To start a new translation please use msginit from the pot file directory. 
    2.29 +
    2.30 +To start a new translation please use msginit from the pot file directory.
    2.31  Example for French/France locale (fr_FR):
    2.32  
    2.33  $ msginit -l fr_FR -o fr.po -i tazinst.pot
     3.1 --- a/tazinst	Sat May 04 18:13:40 2013 +0000
     3.2 +++ b/tazinst	Sat Aug 17 21:44:53 2013 +0200
     3.3 @@ -33,8 +33,7 @@
     3.4  [ -r /etc/slitaz/tazinst.conf ] && . /etc/slitaz/tazinst.conf
     3.5  
     3.6  # version
     3.7 -readonly VERSION=3.90
     3.8 -BANNER="$(gettext "Tazinst - SliTaz GNU/Linux Installer - Version $VERSION")"
     3.9 +readonly VERSION=3.91
    3.10  
    3.11  # i18n
    3.12  . /usr/bin/gettext.sh
    3.13 @@ -81,7 +80,7 @@
    3.14  # bootloaders (key:help)
    3.15  readonly LST_BOOTLOADER="
    3.16  auto:$(gettext 'Automatic selection')
    3.17 -grub:$(gettext 'Grub legacy bootoader')
    3.18 +grub:$(gettext 'Grub legacy bootloader')
    3.19  syslinux:$(gettext 'Lightweight bootloader')"
    3.20  
    3.21  # predefined iso (key:url:help)
    3.22 @@ -112,52 +111,49 @@
    3.23  # print a short help
    3.24  usage()
    3.25  {
    3.26 -	local B1=$(echo -en "\033[1m") B0=$(echo -en "\033[0m")
    3.27 -	cat << EOT
    3.28 +	gettext "SliTaz GNU/Linux Installer - Version:"
    3.29 +	printf ' %s\n' $VERSION
    3.30 +	echo -e "\033[1m"; gettext 'Usage'; echo -e '\033[0m:'
    3.31 +	echo -n '  '; gettext 'tazinst [command] <setting> <value> <file>'; echo
    3.32  
    3.33 -$BANNER
    3.34 -
    3.35 -
    3.36 -$B1$(gettext "Usage"):$B0 $(gettext "tazinst [command] <setting> <value> <file>")
    3.37 -
    3.38 -$B1$(gettext "Commands"): $B0
    3.39 -  new         $(gettext "Create a new install file.")
    3.40 -  set         $(gettext "Change value of a setting.")
    3.41 -  unset       $(gettext "Clear a setting.")
    3.42 -  get         $(gettext "Get the value of a setting.")
    3.43 -  check       $(gettext "Check settings.")
    3.44 -  help        $(gettext "Print a short help on settings")
    3.45 -  list        $(gettext "List system resources.")
    3.46 -  execute     $(gettext "Execute a SliTaz installation.")
    3.47 -  log         $(gettext "Display log file contents.")
    3.48 -  clean       $(gettext "Clean install and log files.")
    3.49 -  version     $(gettext "Print version and exit.")
    3.50 -  usage       $(gettext "Print this short usage.")
    3.51 -
    3.52 -EOT
    3.53 +	echo -e "\033[1m"; gettext 'Commands'; echo -e '\033[0m:'
    3.54 +	printf "  %-12s" "new";		gettext "Create a new install file."; echo
    3.55 +	printf "  %-12s" "set";   	gettext "Change value of a setting."; echo
    3.56 + 	printf "  %-12s" "unset"; 	gettext "Clear a setting."; echo
    3.57 +	printf "  %-12s" "get";   	gettext "Get the value of a setting."; echo
    3.58 +	printf "  %-12s" "check"; 	gettext "Check settings."; echo
    3.59 +	printf "  %-12s" "help";  	gettext "Print a short help on settings"; echo
    3.60 +	printf "  %-12s" "list";  	gettext "List system resources."; echo
    3.61 +	printf "  %-12s" "execute";	gettext "Execute a SliTaz installation."; echo
    3.62 +	printf "  %-12s" "log";   	gettext "Display log file contents."; echo
    3.63 +	printf "  %-12s" "clean"; 	gettext "Clean install and log files."; echo
    3.64 +	printf "  %-12s" "version";	gettext "Print version and exit."; echo
    3.65 +	printf "  %-12s" "usage";  	gettext "Print this short usage."; echo
    3.66  	exit 0
    3.67  }
    3.68  
    3.69  usage_error()
    3.70  {
    3.71 -	local command="$1"
    3.72 -	printf "\n$BANNER\n\n"
    3.73 -	if [ -z "$command" ]; then
    3.74 -		printf "$(gettext 'Error: Missing parameter.')\n"
    3.75 -	else
    3.76 -		printf "\033[1m$command\033[0m: $(gettext 'Unknown command.')\n"
    3.77 -	fi
    3.78 -	local script_name=$(printf "$0" | /bin/busybox awk 'BEGIN{RS="/"}
    3.79 -		{cmd=$command}END{print cmd}')
    3.80 -	printf "$(gettext "Run"): '$script_name help' $(gettext "to get a list \
    3.81 - of available commands").\n\n"
    3.82 +	local cmd="$1" script="$(basename $0)"
    3.83 +	gettext "SliTaz GNU/Linux Installer - Version:"
    3.84 +	printf ' %s\n' $VERSION
    3.85 +	printf "\n'%s': " "$cmd"
    3.86 +	gettext 'Unknown command!'; echo
    3.87 +	gettext 'Run'; printf ": '%s' " "$script help"
    3.88 +	gettext "to get a list of available commands"; echo -e ".\n"
    3.89 +	exit 1
    3.90  }
    3.91  
    3.92  option_error()
    3.93  {
    3.94  	local option="$1" list="$2"
    3.95 -	printf "\n$BANNER\n\n'$option': Unknown setting!\n
    3.96 -Please select one of these options: $list\n\n"
    3.97 +	gettext "SliTaz GNU/Linux Installer - Version:"
    3.98 +	printf ' %s\n' $VERSION
    3.99 +	printf "\n'%s': " "$option"
   3.100 +	gettext 'Unknown option!'; echo
   3.101 +	gettext "Please select one of these options"
   3.102 +	printf ":\n  %s\n\n" "$list"
   3.103 +	exit 1
   3.104  }
   3.105  
   3.106  #---------------------
   3.107 @@ -174,14 +170,14 @@
   3.108  	local install_file=$1
   3.109  	[ -z "$install_file" ] && install_file="$DEFAULT_INSTALL_FILE"
   3.110  	if [ -e "$install_file" ]; then
   3.111 -		echo $(gettext "Warning: file already exists.") 1>&2
   3.112 +		printf "%s\n" "$(gettext "Warning: file already exists.")" 1>&2
   3.113  		exit 0
   3.114  	fi
   3.115  	[ -n "$install_file" ] && touch "$install_file"
   3.116  	if [ -w "$install_file" ]; then
   3.117  		write_file "$install_file"
   3.118  	else
   3.119 -		echo $(gettext "Error: Can't create file.") 1>&2
   3.120 +		printf "%s\n" "$(gettext "Error: Can't create file.")" 1>&2
   3.121  		exit 2
   3.122  	fi
   3.123  }
   3.124 @@ -191,9 +187,9 @@
   3.125  {
   3.126  	local install_file="$1"
   3.127  	cat > "$install_file" << EOT
   3.128 -# $BANNER
   3.129 +# SliTaz GNU/Linux Installer - Version: $VERSION
   3.130  #
   3.131 -# SliTaz Installer setup file.
   3.132 +# Install file.
   3.133  #
   3.134  
   3.135  # Mode of installation:
   3.136 @@ -279,12 +275,12 @@
   3.137  	local install_file="$1"
   3.138  	[ -z "$install_file" ] && install_file="$DEFAULT_INSTALL_FILE"
   3.139  	if ! [ -r "$install_file" ]; then
   3.140 -		echo $(gettext "Error: Unable to read install file") 1>&2
   3.141 +		printf "%s\n" "$(gettext "Error: Unable to read install file")" 1>&2
   3.142  		exit 2
   3.143  	fi
   3.144  	#
   3.145  	if ! CONTENTS="$(cat "$install_file")"; then
   3.146 -		echo $(gettext "Error: Unable to read install file") 1>&2
   3.147 +		printf "%s\n" "$(gettext "Error: Unable to read install file")" 1>&2
   3.148  		exit 2
   3.149  	fi
   3.150  }
   3.151 @@ -318,7 +314,7 @@
   3.152  		upgrade)
   3.153  			echo "mode media source root_uuid bootloader winboot" ;;
   3.154  		*)
   3.155 -			echo "$SETTINGS" ;;
   3.156 +			printf "%s\n" "$SETTINGS" ;;
   3.157  	esac
   3.158  }
   3.159  
   3.160 @@ -361,7 +357,7 @@
   3.161  	# validate setting
   3.162  	if ! printf "%s" "$setting" | \
   3.163  			egrep -q "$(regex "$SETTINGS")"; then
   3.164 -		echo $(gettext "Error: '$setting' unknown setting.") 1>&2
   3.165 +		printf "%s\n" "$(gettext "Error: '$setting' unknown setting.")" 1>&2
   3.166  		exit 1
   3.167  	fi
   3.168  	# and file
   3.169 @@ -389,7 +385,8 @@
   3.170  		read_file "$install_file"
   3.171  		check "$setting"
   3.172  	else
   3.173 -		echo $(gettext "Error: Unable to write to install file.") 1>&2
   3.174 +		printf "%s\n" \
   3.175 +			"$(gettext "Error: Unable to write to install file.")" 1>&2
   3.176  		exit 2
   3.177  	fi
   3.178  }
   3.179 @@ -400,35 +397,35 @@
   3.180  	MODE="$(get mode)"
   3.181  	local settings="$(get settings)"
   3.182  	MEDIA="$(get media)"
   3.183 -	printf "source" | egrep -q "$(regex "$settings")" \
   3.184 +	echo "source" | egrep -q "$(regex "$settings")" \
   3.185  		&& SOURCE="$(get source)" \
   3.186  		|| unset SOURCE
   3.187  	ROOT_UUID="$(get root_uuid)"
   3.188 -	printf "root_format" | egrep -q "$(regex "$settings")" \
   3.189 +	echo "root_format" | egrep -q "$(regex "$settings")" \
   3.190  		&& ROOT_FORMAT="$(get root_format)" \
   3.191  		|| unset ROOT_FORMAT
   3.192 -	printf "home_uuid" | egrep -q "$(regex "$settings")" \
   3.193 +	echo "home_uuid" | egrep -q "$(regex "$settings")" \
   3.194  		&& HOME_UUID="$(get home_uuid)" \
   3.195  		|| unset HOME_UUID
   3.196 -	printf "home_format" | egrep -q "$(regex "$settings")" \
   3.197 +	echo "home_format" | egrep -q "$(regex "$settings")" \
   3.198  		&& HOME_FORMAT="$(get home_format)" \
   3.199  		|| unset HOME_FORMAT
   3.200 -	printf "hostname" | egrep -q "$(regex "$settings")" \
   3.201 +	echo "hostname" | egrep -q "$(regex "$settings")" \
   3.202  		&& HOSTNAME="$(get hostname)" \
   3.203  		|| unset HOSTNAME
   3.204 -	printf "root_pwd" | egrep -q "$(regex "$settings")" \
   3.205 +	echo "root_pwd" | egrep -q "$(regex "$settings")" \
   3.206  		&& ROOT_PWD="$(get root_pwd)" \
   3.207  		|| unset ROOT_PWD
   3.208 -	printf "user_login" | egrep -q "$(regex "$settings")" \
   3.209 +	echo "user_login" | egrep -q "$(regex "$settings")" \
   3.210  		&& USER_LOGIN="$(get user_login)" \
   3.211  		|| unset USER_LOGIN
   3.212 -	printf "user_pwd" | egrep -q "$(regex "$settings")" \
   3.213 +	echo "user_pwd" | egrep -q "$(regex "$settings")" \
   3.214  		&& USER_PWD="$(get user_pwd)" \
   3.215  		|| unset USER_PWD
   3.216 -	printf "bootloader" | egrep -q "$(regex "$settings")" \
   3.217 +	echo "bootloader" | egrep -q "$(regex "$settings")" \
   3.218  		&& BOOTLOADER="$(get bootloader)" \
   3.219  		|| unset BOOTLOADER
   3.220 -	printf "winboot" | egrep -q "$(regex "$settings")" \
   3.221 +	echo "winboot" | egrep -q "$(regex "$settings")" \
   3.222  		&& WINBOOT="$(get winboot)" \
   3.223  		|| unset WINBOOT
   3.224  }
   3.225 @@ -443,9 +440,9 @@
   3.226  	# rm install file
   3.227  	local install_file="$1"
   3.228  	[ -z "$install_file" ] && install_file="$DEFAULT_INSTALL_FILE"
   3.229 -	echo "$(gettext "Deleting install file:") $install_file"
   3.230 +	printf "%s: %s\n" "$(gettext "Deleting install file")" "$install_file"
   3.231  	if ! [ -w "$install_file" ]; then
   3.232 -		echo $(gettext "Error: Unable to delete install file") 1>&2
   3.233 +		printf "%s\n" "$(gettext "Error: Unable to delete install file")" 1>&2
   3.234  		exit 2
   3.235  	else
   3.236  		rm -f "$install_file"
   3.237 @@ -471,23 +468,24 @@
   3.238  check_instance()
   3.239  {
   3.240  	if [ -e "$LOCK" ]; then
   3.241 -		echo $(gettext "Another instance of tazinst is running.") 1>&2
   3.242 +		printf "%s\n" $(gettext "Another instance of tazinst is running.") 1>&2
   3.243  		exit 7
   3.244  	else
   3.245 -		printf "$$" > $LOCK
   3.246 +		printf "%s" "$$" > $LOCK
   3.247  	fi
   3.248  }
   3.249  
   3.250  # exit if the setting is not in a list of keywords
   3.251  check_key()
   3.252  {
   3.253 -	local setting="$1" keylist="$2" keyword="$(get $1)"
   3.254 +	local setting="$1" keylist="$2" keyword="$(get $1)" msg
   3.255  	if ! printf "%s" "$keyword" | \
   3.256  			egrep -q "$(regex "$keylist")"; then
   3.257 -		printf "$setting=$keyword
   3.258 +		msg="$setting=$keyword
   3.259  $(gettext 'Error:') '$keyword' $(gettext 'Invalid keyword.')
   3.260  $(gettext 'Select one of these options:') $keylist
   3.261 -$(gettext 'For more information, see tazinst Manual.')\n" 1>&2
   3.262 +$(gettext 'For more information, see tazinst Manual.')"
   3.263 +		printf "%s\n" "$msg" 1>&2
   3.264  		exit 1
   3.265  	fi
   3.266  }
   3.267 @@ -495,14 +493,15 @@
   3.268  # exit if the partition does not exist
   3.269  check_uuid()
   3.270  {
   3.271 -	local setting="$1" value="$(get $1)" found=0 partition
   3.272 +	local setting="$1" value="$(get $1)" found=0 partition msg
   3.273  	for partition in $(list_uuid); do
   3.274  		[ "$partition" == "$value" ] && found="$(($found + 1))"
   3.275  	done
   3.276  	if [ "$found" != "1" ]; then
   3.277 -		printf "$(gettext "$setting")=$value
   3.278 +		msg="$(gettext "$setting")=$value
   3.279  $(gettext 'Error: Partition not found')
   3.280 -$(gettext 'To see available partitions, run') 'tazinst list uuid'.\n" 1>&2
   3.281 +$(gettext 'To see available partitions, run') 'tazinst list uuid'."
   3.282 +		printf "%s\n" "$msg" 1>&2
   3.283  		exit 1
   3.284  	fi
   3.285  }
   3.286 @@ -516,7 +515,7 @@
   3.287  			check_uuid source ;;
   3.288  		iso)
   3.289  			if [ ! -r "$source" ]; then
   3.290 -				echo $(gettext "Error: Source file not found") 1>&2
   3.291 +				printf "%s.\n" "$(gettext "Error: Source file not found")" 1>&2
   3.292  				exit 1
   3.293  			fi ;;
   3.294  		web)
   3.295 @@ -531,7 +530,7 @@
   3.296  			printf "%s" "$source" | \
   3.297  				egrep -q "$regexp" && valid=$(($valid+1))
   3.298  			if [ "$valid" -le "0" ]; then
   3.299 -				echo $(gettext "Error: invalid URL"). 1>&2
   3.300 +				printf "%s.\n" "$(gettext "Error: invalid URL")" 1>&2
   3.301  				exit 1
   3.302  			fi
   3.303  	esac
   3.304 @@ -542,12 +541,12 @@
   3.305  {
   3.306  	local list all nodup
   3.307  	list="$(get root_uuid) $(get source) $(get home_uuid) $(get winboot)"
   3.308 -	all="$(echo $list | wc -w)"
   3.309 -	nodup="$(echo $list | /bin/busybox awk 'BEGIN{RS=" "}{print $0}' | \
   3.310 -		sort | uniq | wc -w)"
   3.311 +	all="$(printf "%s" "$list" | wc -w)"
   3.312 +	nodup="$(printf "%s" "$list" | /bin/busybox awk 'BEGIN{RS=" "}{print $0}' \
   3.313 +		| sort | uniq | wc -w)"
   3.314  	if [ "$all" != "$nodup" ]; then
   3.315 -		printf "$(gettext "Error: multiple assignations for a disk. Please \
   3.316 -check your settings.")\n"
   3.317 +		printf "%s\n" \
   3.318 +			"$(gettext "Error: multiple assignations for a disk.")" 1>&2
   3.319  		exit 1
   3.320  	fi
   3.321  }
   3.322 @@ -560,12 +559,13 @@
   3.323  	local errcode=0
   3.324  	# too long
   3.325  	if [ "${#pass}" -ge 40 ]; then
   3.326 -		echo $(gettext "Error: password too long") 1>&2
   3.327 +		printf "%s\n" "$(gettext "Error: password too long")" 1>&2
   3.328  		exit 1
   3.329  	fi
   3.330  	# bad chars
   3.331 -	if ! (echo "$pass" | egrep -q "$invalid"); then
   3.332 -		echo  $(gettext "Error: Unallowed characters in password.") 1>&2
   3.333 +	if ! (printf "%s" "$pass" | egrep -q "$invalid"); then
   3.334 +		printf "%s\n" \
   3.335 +			"$(gettext "Error: Unallowed characters in password.")" 1>&2
   3.336  		exit 1
   3.337  	fi
   3.338  	# short pwd
   3.339 @@ -574,9 +574,9 @@
   3.340  	[ -z "$pass" ] && errcode=129
   3.341  	case "$errcode" in
   3.342  		128)
   3.343 -			echo $(gettext "Warning: short password!") 1>&2 ;;
   3.344 +			printf "%s\n" "$(gettext "Warning: short password!")" 1>&2 ;;
   3.345  		129)
   3.346 -			echo $(gettext "Warning: no password!") 1>&2 ;;
   3.347 +			printf "%s\n" "$(gettext "Warning: no password!")" 1>&2 ;;
   3.348  	esac
   3.349  	return "$errcode"
   3.350  }
   3.351 @@ -584,18 +584,19 @@
   3.352  # exit if a name is invalid
   3.353  check_name()
   3.354  {
   3.355 -	local name="$1" value="$(get "$1")"
   3.356 +	local name="$1" value="$(get "$1")" msg
   3.357 +	msg="$name=$value"
   3.358   	if [ "${#value}" -lt 2 ]; then
   3.359 -		printf "$name=$value\n$(gettext "Error: Too short.")\n" 1>&2
   3.360 +		printf "%s %s\n" "$msg"	"(gettext "Error: Too short.")\n" 1>&2
   3.361  		exit 1
   3.362  	fi
   3.363  	if [ "${#value}" -gt 32 ]; then
   3.364 -		printf "$name=$value\n$(gettext "Error: Too long.")\n" 1>&2
   3.365 +		printf "%s %s\n" "$msg" "$(gettext "Error: Too long.")\n" 1>&2
   3.366  		exit 1
   3.367  	fi
   3.368 -	if printf "$value" | \
   3.369 +	if printf "%s" "$value" | \
   3.370  			grep -q "[[:space:]\&\"\'\(\)\|\*\\#\`\+\:/;<>]"; then
   3.371 -		printf "$name='$value'\n$(gettext "Error: Invalid chars.")\n" 1>&2
   3.372 +		printf "%s %s\n" "$msg" "$(gettext "Error: Invalid chars.")\n" 1>&2
   3.373  		exit 1
   3.374  	fi
   3.375  }
   3.376 @@ -606,7 +607,8 @@
   3.377  	local bootloader=$(get bootloader)
   3.378  	local winboot=$(get winboot)
   3.379  	if [ -z "$bootloader" ] && [ -n "$winboot" ]; then
   3.380 -		echo $(gettext "Error: Dualboot set with no bootloader.") 1>&2
   3.381 +		printf "%s\n" \
   3.382 +			"$(gettext "Error: Dualboot set with no bootloader.")" 1>&2
   3.383  		exit 1
   3.384  	fi
   3.385  }
   3.386 @@ -618,14 +620,14 @@
   3.387  	# get root uuid
   3.388  	local uuid="$(get root_uuid)"
   3.389  	if [ "$(/sbin/blkid | grep -c "$uuid")" == "1" ]; then
   3.390 -		if ! printf "$(p_table $uuid)" | \
   3.391 +		if ! printf "%s" "$(p_table $uuid)" | \
   3.392  				egrep -q "$(regex "$pt_list")"; then
   3.393 -			echo $(gettext "Error: Unsupported Partition Table") 1>&2
   3.394 +			printf "%s\n" "$(gettext "Error: Unsupported Partition Table")" 1>&2
   3.395  			exit 1
   3.396  		fi
   3.397  	else
   3.398 -		echo $(gettext "Error: No disk selected, can't install any \
   3.399 -bootloader.") 1>&2
   3.400 +		printf "%s\n" \
   3.401 +	"$(gettext "Error: No disk selected, can't install any bootloader.")" 1>&2
   3.402  		exit 1
   3.403  	fi
   3.404  }
   3.405 @@ -742,12 +744,13 @@
   3.406  
   3.407  help_source()
   3.408  {
   3.409 -	printf "$(gettext "The Source setting depends on the type of media:")\n"
   3.410 +	printf "%s\n" \
   3.411 +		"$(gettext "The Source setting depends on the type of media:")"
   3.412  	printf "%-12s%s\n" "cdrom" "$(help cdrom)"
   3.413  	printf "%-12s%s\n" "usb" "$(help usb)"
   3.414  	printf "%-12s%s\n" "iso" "$(help iso)"
   3.415 -	printf "%-12s%s\n" "web" "$(gettext "Name or URL of the image on the web. \
   3.416 -Type: tazinst help web")"
   3.417 +	printf "%-12s%s" "web" "$(gettext "Name or URL of the image on the web.")"
   3.418 +	printf "%s\n" "$(gettext "Type: tazinst help web")"
   3.419  }
   3.420  
   3.421  help_all()
   3.422 @@ -765,8 +768,9 @@
   3.423  user_pwd:$(gettext "First user password")
   3.424  bootloader:$(gettext "Install a bootloader")
   3.425  winboot:$(gettext "Partition to duaboot Windows from")"
   3.426 -	printf "$(gettext "List of settings:")\n"
   3.427 -	printf "$text" | /bin/busybox awk -F: '/..*/{printf "%-12s%s\n", $1, $2}'
   3.428 +	printf "%s\n" "$(gettext "List of settings:")"
   3.429 +	printf "%s" "$text" | \
   3.430 +		/bin/busybox awk -F: '/..*/{printf "%-12s%s\n", $1, $2}'
   3.431  }
   3.432  
   3.433  # help command
   3.434 @@ -775,45 +779,47 @@
   3.435  	local setting="$1"
   3.436  	case "$setting" in
   3.437  	mode)
   3.438 -		echo "$LST_MODE" | \
   3.439 +		printf "%s" "$LST_MODE" | \
   3.440  			/bin/busybox awk -F: '/..*/{printf "%-12s%s\n", $1, $2}' ;;
   3.441  	media)
   3.442 -		echo "$LST_MEDIA" | \
   3.443 +		printf "%s" "$LST_MEDIA" | \
   3.444  			/bin/busybox awk -F: '/..*/{printf "%-12s%s\n", $1, $2}'	;;
   3.445  	source)
   3.446  		help_source ;;
   3.447  	cdrom)
   3.448 -		echo "$(gettext "Automatically set")" ;;
   3.449 +		printf "%s\n" "$(gettext "CD. Automatically set")" ;;
   3.450  	usb)
   3.451 -		echo "$(gettext "USB partition. For a list, type: tazinst list usb")" ;;
   3.452 +		printf "%s\n" \
   3.453 +			"$(gettext "USB partition. For a list, type: tazinst list usb")" ;;
   3.454  	iso)
   3.455 -		echo "$(gettext "ISO file name. For a list, type: tazinst list iso")" ;;
   3.456 +		printf "%s\n" \
   3.457 +			"$(gettext "ISO file name. For a list, type: tazinst list iso")" ;;
   3.458  	web)
   3.459 -		echo "$LST_WEB" | \
   3.460 +		printf "%s" "$LST_WEB" | \
   3.461  			/bin/busybox awk -F: '/..*/{printf "%-12s%s\n", $1, $3}' ;;
   3.462  	root_uuid)
   3.463  	 	/sbin/blkid -s TYPE -s LABEL | sort ;;
   3.464  	root_format)
   3.465 -	 	echo "$LST_FORMAT" | \
   3.466 +	 	printf "%s" "$LST_FORMAT" | \
   3.467  			/bin/busybox awk -F: '/..*/{printf "%-12s%s\n", $1, $2}' ;;
   3.468  	home_uuid)
   3.469  		/sbin/blkid -s TYPE -s LABEL | sort ;;
   3.470  	home_format)
   3.471 -		echo "$LST_FORMAT" | \
   3.472 +		printf "%s" "$LST_FORMAT" | \
   3.473  				/bin/busybox awk -F: '/..*/{printf "%-12s%s\n", $1, $2}' ;;
   3.474  	hostname)
   3.475 -		echo "$(gettext "Name of the system")" ;;
   3.476 +		printf "%s\n" "$(gettext "Name of the system")" ;;
   3.477  	root_pwd)
   3.478 -		echo "$(gettext "Superuser password")" ;;
   3.479 +		printf "%s\n" "$(gettext "Superuser password")" ;;
   3.480  	user_login)
   3.481 -		echo "$(gettext "First user name")" ;;
   3.482 +		printf "%s\n" "$(gettext "First user name")" ;;
   3.483  	user_pwd)
   3.484 -		echo "$(gettext "First user password")" ;;
   3.485 +		printf "%s\n" "$(gettext "First user password")" ;;
   3.486  	bootloader)
   3.487 -		printf "$LST_BOOTLOADER" | \
   3.488 +		printf "%s" "$LST_BOOTLOADER" | \
   3.489  			/bin/busybox awk -F: '/..*/{printf "%-12s%s\n",$1,$2}' ;;
   3.490  	winboot)
   3.491 -		echo "$(gettext "Partition containing Windows, or 'auto'")" ;;
   3.492 +		printf "%s\n" "$(gettext "Partition containing Windows, or 'auto'")" ;;
   3.493  	""|all)
   3.494  	help_all ;;
   3.495  	*)
   3.496 @@ -841,7 +847,7 @@
   3.497  				media="$media $key"
   3.498  		esac
   3.499  	done
   3.500 -	echo "$media" | sed 's/^\s//'
   3.501 +	printf "%s" "$media" | sed 's/^\s//'
   3.502  }
   3.503  
   3.504  list_usb()
   3.505 @@ -870,7 +876,7 @@
   3.506  list_iso()
   3.507  {
   3.508  	for i in /root/*.iso /home/*/*.iso /home/*/*/*.iso ; do
   3.509 -		echo $i | grep -v "*"
   3.510 +		printf "%s" $i | grep -v "*"
   3.511  	done
   3.512  }
   3.513  
   3.514 @@ -885,7 +891,7 @@
   3.515  	type mkfs.minix > /dev/null && fs="$fs minix"
   3.516  	type mkfs.reiser4 > /dev/null && fs="$fs reiser4"
   3.517  	type mkfs.xfs > /dev/null && fs="$fs xfs"
   3.518 -	echo "$fs" | sed 's/^\s//'
   3.519 +	printf "%s" "$fs" | sed 's/^\s//'
   3.520  }
   3.521  
   3.522  # list partitions
   3.523 @@ -911,8 +917,8 @@
   3.524  {
   3.525  	local key="$1"
   3.526  	# print url of a given iso
   3.527 -	if printf "$LST_WEB" | egrep -q "^$key:"; then
   3.528 -		printf "$LST_WEB" | egrep "^$key:" | \
   3.529 +	if printf "%s" "$LST_WEB" | egrep -q "^$key:"; then
   3.530 +		printf "%s" "$LST_WEB" | egrep "^$key:" | \
   3.531  			/bin/busybox awk -F: '{print $2}'
   3.532  	fi
   3.533  	# print all key
   3.534 @@ -926,7 +932,7 @@
   3.535  	local btlr
   3.536  	type grub-install > /dev/null && btlr=" grub"
   3.537  	type syslinux > /dev/null && btlr="$btlr syslinux"
   3.538 -	[ -n "$btlr" ] && printf "auto$btlr\n"
   3.539 +	[ -n "$btlr" ] && printf "%s\n" "auto$btlr"
   3.540  }
   3.541  
   3.542  # list Windows partitions
   3.543 @@ -982,7 +988,7 @@
   3.544  	local ressource="$1"
   3.545  	case "$ressource" in
   3.546  		mode)
   3.547 -			echo "$(key "$LST_MODE")" ;;
   3.548 +			printf "%s\n" "$(key "$LST_MODE")" ;;
   3.549  		media)
   3.550  			list_media ;;
   3.551  		iso)
   3.552 @@ -1002,15 +1008,15 @@
   3.553  		partition_table)
   3.554  			list_partition_table ;;
   3.555  		""|all)
   3.556 -			printf "* mode:\n$(key "$LST_MODE")\n\n"
   3.557 -			printf "* media:\n$(list_media)\n\n"
   3.558 -			printf "* usb:\n$(list usb)\n\n"
   3.559 -			printf "* iso:\n$(list_iso)\n\n"
   3.560 -			printf "* web:\n$(list_web)\n\n"
   3.561 -			printf "* format:\n$(list_format)\n\n"
   3.562 -			printf "* bootloader:\n$(list_bootloader)\n\n"
   3.563 -			printf "* partition_table:\n$(list_partition_table)\n\n"
   3.564 -			printf "* winboot:\n$(list_winboot)\n"
   3.565 +			printf "* mode:\n%s\n\n" "$(key "$LST_MODE")"
   3.566 +			printf "* media:\n%s\n\n" "$(list_media)"
   3.567 +			printf "* usb:\n%s\n\n" "$(list usb)"
   3.568 +			printf "* iso:\n%s\n\n" "$(list_iso)"
   3.569 +			printf "* web:\n%s\n\n" "$(list_web)"
   3.570 +			printf "* format:\n%s\n\n" "$(list_format)"
   3.571 +			printf "* bootloader:\n%s\n\n" "$(list_bootloader)"
   3.572 +			printf "* partition_table:\n%s\n\n" "$(list_partition_table)"
   3.573 +			printf "* winboot:\n%s\n" "$(list_winboot)"
   3.574  			;;
   3.575  		*)
   3.576  			local options="mode media usb iso web uuid format bootloader \
   3.577 @@ -1026,7 +1032,7 @@
   3.578  # list indexes from a list
   3.579  key()
   3.580  {
   3.581 -	printf "$1" | /bin/busybox awk -F: 'BEGIN{
   3.582 +	printf "%s" "$1" | /bin/busybox awk -F: 'BEGIN{
   3.583  		other=-1
   3.584  		}
   3.585  		!/^#|^$/{
   3.586 @@ -1042,18 +1048,18 @@
   3.587  # convert a list of words to a regex
   3.588  regex()
   3.589  {
   3.590 -	printf "^$1$" | sed s'/ /$|^/g'
   3.591 +	printf "%s" "^$1$" | sed s'/ /$|^/g'
   3.592  }
   3.593  
   3.594  # print dev from uuid
   3.595  uuid2dev()
   3.596  {
   3.597  	local uuid="$1" id
   3.598 -	if [ "$(echo $uuid | cut -d '=' -f1)" = "UUID" ]; then
   3.599 -		id="$(echo $uuid | cut -d'=' -f2)"
   3.600 +	if [ "$(printf "%s" $uuid | cut -d '=' -f1)" = "UUID" ]; then
   3.601 +		id="$(printf "%s" $uuid | cut -d'=' -f2)"
   3.602  		printf "$(/sbin/blkid -U $id)"
   3.603  	else
   3.604 -		printf "$uuid"
   3.605 +		printf "%s" "$uuid"
   3.606  	fi
   3.607  }
   3.608  
   3.609 @@ -1061,17 +1067,17 @@
   3.610  uuid2disk()
   3.611  {
   3.612  	local uuid="$1"
   3.613 -	printf "$(uuid2dev $uuid | /bin/busybox awk '{print substr($0,1,8)}')"
   3.614 +	printf "%s" "$(uuid2dev $uuid | /bin/busybox awk '{print substr($0,1,8)}')"
   3.615  }
   3.616  
   3.617  dev2uuid()
   3.618  {
   3.619  	local uuid="$1"
   3.620 -	if printf "$uuid" | grep -q dev; then
   3.621 -		printf "UUID=$(/sbin/blkid -p -i -o udev "$uuid" \
   3.622 +	if printf "%s" "$uuid" | grep -q dev; then
   3.623 +		printf "UUID=%s" "$(/sbin/blkid -p -i -o udev "$uuid" \
   3.624  			| grep ID_FS_UUID= | cut -d '=' -f2)"
   3.625  	else
   3.626 -		printf "$uuid"
   3.627 +		printf "%s" "$uuid"
   3.628  	fi
   3.629  }
   3.630  
   3.631 @@ -1080,7 +1086,7 @@
   3.632  {
   3.633  	local uuid="$1" device
   3.634  	device="$(uuid2disk $uuid)"
   3.635 -	printf "$(/usr/sbin/parted -lm | grep "$device" | \
   3.636 +	printf "%s" "$(/usr/sbin/parted -lm | grep "$device" | \
   3.637  		cut -d':' -f6)"
   3.638  }
   3.639  
   3.640 @@ -1092,7 +1098,7 @@
   3.641  		grep "$(uuid2dev $uuid)" | cut -d' ' -f3)"
   3.642  	fs="${fs#TYPE=\"}"
   3.643  	fs="${fs%\"}"
   3.644 -	printf "$fs"
   3.645 +	printf "%s" "$fs"
   3.646  }
   3.647  
   3.648  # return removable status from uuid
   3.649 @@ -1100,7 +1106,7 @@
   3.650  {
   3.651  	local uuid="$1" removable=1
   3.652  	local disk="$(uuid2disk $uuid | /bin/busybox awk '{print substr($0,6,3)}')"
   3.653 -	if [ "$(echo $disk | wc -w)" -eq "1" ]; then
   3.654 +	if [ "$(printf "%s" $disk | wc -w)" -eq "1" ]; then
   3.655  		[ "$(cat /sys/block/"$disk"/removable)" -gt "0" ] \
   3.656  			&& removable=0
   3.657  	fi
   3.658 @@ -1130,7 +1136,7 @@
   3.659  	mkdir -p /tmp/tazinst
   3.660  	for mirror in $MIRRORS; do
   3.661  		log "$(gettext "Downloading:") $mirror$file"
   3.662 -		oldfile="$(printf $file | \
   3.663 +		oldfile="$(printf "%s" $file | \
   3.664  			/bin/busybox awk 'BEGIN{RS="/"}{text=$1}END{print text}')"
   3.665  		[ -e "/tmp/tazinst/$oldfile" ] && rm -f "/tmp/tazinst/$oldfile"
   3.666  		/bin/busybox wget $mirror$file -P /tmp/tazinst && transfer=1 && break
   3.667 @@ -1172,14 +1178,14 @@
   3.668  # start log
   3.669  log_open()
   3.670  {
   3.671 -	printf "=== Tazinst: started on $(date "+%x %X") ===\n" > "$LOG"
   3.672 +	printf "%s\n" "=== Tazinst: started on $(date "+%x %X") ===" > "$LOG"
   3.673  	LOGGING="true"
   3.674  }
   3.675  
   3.676  # print and log a comment
   3.677  log(){
   3.678  	# for front-ends, sleep 1 if $1 is num
   3.679 -	printf "$1" | awk '{
   3.680 +	printf "%s" "$1" | awk '{
   3.681  		num=$1+0
   3.682  		if(num>0 && num<=100)
   3.683  			exit 0
   3.684 @@ -1187,8 +1193,8 @@
   3.685  			exit 1
   3.686  		}' && sleep 1
   3.687  	# log
   3.688 -	printf "$1\n"
   3.689 -	[ -n "$LOGGING" ] && printf "$1\n" >> $LOG
   3.690 +	printf "%s\n" "$1"
   3.691 +	[ -n "$LOGGING" ] && printf "%s\n" "$1" >> $LOG
   3.692  }
   3.693  
   3.694  #--------------------
   3.695 @@ -1199,13 +1205,13 @@
   3.696  error()
   3.697  {
   3.698  	local error="$1" msg="$2" cancel="$(gettext "Process not completed")"
   3.699 -	printf "$(gettext "Error"): $msg\n$cancel\n" 1>&2
   3.700 +	printf "%s: %s\n%s\n" "$(gettext "Error")" "$msg" "$cancel" 1>&2
   3.701  	if [ -n "$LOGGING" ]; then
   3.702  		# 1st pattern
   3.703 -		printf "-x-x- \n" >> "$LOG"
   3.704 -		printf "$(gettext "Error") $error: $msg\n$cancel\n" >> "$LOG"
   3.705 +		echo "-x-x- " >> "$LOG"
   3.706 +		printf "%s: %s\n%s\n" "$(gettext "Error")" "$msg" "$cancel" >> "$LOG"
   3.707  		# 2nd pattern
   3.708 -		printf "x-x-x \n" >> "$LOG"
   3.709 +		echo "x-x-x " >> "$LOG"
   3.710  		printf "=== Tazinst error on $(date "+%x %X") ===\n" >> "$LOG"
   3.711  	fi
   3.712  	unset LOGGING
   3.713 @@ -1268,7 +1274,7 @@
   3.714  mount_iso()
   3.715  {
   3.716  	# check integrity
   3.717 -	local md5file=$(echo $SOURCE | sed 's/.iso$/.md5/')
   3.718 +	local md5file=$(printf "%s" $SOURCE | sed 's/.iso$/.md5/')
   3.719  	if [ -r "$md5file" ]; then
   3.720  		local md5ref="$(cat "$md5file" | cut -d' ' -f1)"
   3.721  		local md5calc="$(md5sum $SOURCE | cut -d' ' -f1)"
   3.722 @@ -1291,14 +1297,14 @@
   3.723  # ISO file on the web
   3.724  mount_web()
   3.725  {
   3.726 -	if (echo "$SOURCE" | egrep -q "$(regex "$(list web)")"); then
   3.727 +	if (printf "%s" "$SOURCE" | egrep -q "$(regex "$(list web)")"); then
   3.728  		SOURCE="$(list web $SOURCE)"
   3.729  	fi
   3.730  	dnl "$SOURCE"
   3.731 -	local md5file="$(echo $SOURCE | sed 's/.iso$/.md5/')"
   3.732 +	local md5file="$(printf "%s" $SOURCE | sed 's/.iso$/.md5/')"
   3.733  	dnl "$md5file"
   3.734 -	local webiso="$(echo $SOURCE | /bin/busybox awk 'BEGIN{RS="/"}{out=$1}
   3.735 -		END{printf"%s",out}')"
   3.736 +	local webiso="$(printf "%s" $SOURCE | \
   3.737 +		/bin/busybox awk 'BEGIN{RS="/"}{out=$1}	END{printf "%s",out}')"
   3.738  	SOURCE="/tmp/tazinst/$webiso"
   3.739  	mount_iso
   3.740  }
   3.741 @@ -1341,7 +1347,7 @@
   3.742  	local uuid="$1" fmt="$2" dest="$3" dev format
   3.743  	log "$(gettext "Format") $uuid ($fmt)"
   3.744  	format="mkfs.$fmt"
   3.745 -	if (printf "$uuid" | grep -q "UUID="); then
   3.746 +	if (printf "%s" "$uuid" | grep -q "UUID="); then
   3.747  		# case UUID=
   3.748  		dev="$(uuid2dev $uuid)"
   3.749  		"$format" "$dev" >>"$LOG" 2>>"$LOG" || error 4 "Formatting has failed"
   3.750 @@ -1440,7 +1446,7 @@
   3.751  {
   3.752  	log "\n$(gettext "Process completed. You can now restart (reboot)")"
   3.753  	log "$(gettext "from your SliTaz GNU/Linux system.")"
   3.754 -	printf "=== Tazinst ended on $(date "+%x %X") ===\n" >> "$LOG"
   3.755 +	printf "%s\n" "=== Tazinst ended on $(date "+%x %X") ===" >> "$LOG"
   3.756  	unset LOGGING
   3.757  	# saving log
   3.758  	log "$(gettext "Copying log to /var/log/tazinst.log")"
   3.759 @@ -1463,10 +1469,10 @@
   3.760  	if [ "$BOOTLOADER" == "auto" ]; then
   3.761  		# use syslinux, but if p_table=msdos take grub (if available)
   3.762  		unset BOOTLOADER
   3.763 -		printf "$(list_bootloader)" | \
   3.764 +		printf "%s" "$(list_bootloader)" | \
   3.765  			grep -q "syslinux" && BOOTLOADER=syslinux
   3.766  		if [ "$(p_table $ROOT_UUID)" == "msdos" ]; then
   3.767 -			printf "$(list_bootloader)" | \
   3.768 +			printf "%s" "$(list_bootloader)" | \
   3.769  				grep -q " grub" && BOOTLOADER=grub
   3.770  		fi
   3.771  	fi
   3.772 @@ -1496,7 +1502,7 @@
   3.773  partnum()
   3.774  {
   3.775  	local partition="$(uuid2dev $1)"
   3.776 -	printf "$((${partition#/dev/[h-s]d[a-z]}-1))\n"
   3.777 +	printf "%s\n" "$((${partition#/dev/[h-s]d[a-z]}-1))"
   3.778  }
   3.779  
   3.780  # print root device
   3.781 @@ -1506,10 +1512,10 @@
   3.782  	case "$(p_table $partition)" in
   3.783  		msdos)
   3.784  			# print device
   3.785 -			printf "$(uuid2dev $partition)" ;;
   3.786 +			printf "%s" "$(uuid2dev $partition)" ;;
   3.787  		gpt)
   3.788  			# print PARTUUID (different from UUID)
   3.789 -			printf "PARTUUID="
   3.790 +			printf "%s" "PARTUUID="
   3.791  			/sbin/blkid -p -i -o udev $(uuid2dev $partition) \
   3.792  				| grep ENTRY_UUID | cut -d '=' -f2 ;;
   3.793  	esac
   3.794 @@ -1518,7 +1524,7 @@
   3.795  # add rootdelay for removable devices
   3.796  rootdelay()
   3.797  {
   3.798 -	is_removable "$ROOT_UUID" && printf "rootdelay=9"
   3.799 +	is_removable "$ROOT_UUID" && printf "%s" "rootdelay=9"
   3.800  }
   3.801  
   3.802  # print winboot uuid
   3.803 @@ -1527,9 +1533,9 @@
   3.804  	if [ "$WINBOOT" = "auto" ]; then
   3.805  		# get the first uuid if any
   3.806  		[ $(list_winboot | wc -w) -gt 1 ] \
   3.807 -			&& printf "$(list_winboot | cut -d' ' -f2)"
   3.808 +			&& printf "%s" "$(list_winboot | cut -d' ' -f2)"
   3.809  	else
   3.810 -		printf "$WINBOOT"
   3.811 +		printf "%s" "$WINBOOT"
   3.812  	fi
   3.813  }
   3.814  
   3.815 @@ -1585,10 +1591,10 @@
   3.816  	fi
   3.817  
   3.818  	# log
   3.819 -	printf "/boot/grub/menu.lst:\n" >> "$LOG"
   3.820 -	printf "--- menu.lst -------------\n" >> "$LOG"
   3.821 +	printf "%s\n" "/boot/grub/menu.lst:" >> "$LOG"
   3.822 +	printf "%s\n" "--- menu.lst -------------" >> "$LOG"
   3.823  	cat $TARGET_ROOT/boot/grub/menu.lst >> "$LOG"
   3.824 -	printf "--- menu.lst -------------\n\n" >> "$LOG"
   3.825 +	printf "%s\n\n" "--- menu.lst -------------" >> "$LOG"
   3.826  }
   3.827  
   3.828  # GRUB info with disk name used for grub
   3.829 @@ -1687,10 +1693,10 @@
   3.830  EOF
   3.831  	fi
   3.832  	# log
   3.833 -	printf "/boot/syslinux/syslinux.cfg:\n" >> "$LOG"
   3.834 -	printf "--- syslinux.cfg -------------\n" >> "$LOG"
   3.835 +	printf "%s\n" "/boot/syslinux/syslinux.cfg:" >> "$LOG"
   3.836 +	printf "%s\n" "--- syslinux.cfg -------------" >> "$LOG"
   3.837  	cat $TARGET_ROOT/boot/syslinux/syslinux.cfg >> "$LOG"
   3.838 -	printf "--- syslinux.cfg -------------\n\n" >> "$LOG"
   3.839 +	printf "%s\n\n" "--- syslinux.cfg -------------" >> "$LOG"
   3.840  }
   3.841  
   3.842  # install syslinux
   3.843 @@ -1900,8 +1906,8 @@
   3.844  	sed	-i s#'CHECK_FS=\"\"'#"CHECK_FS=\"$ROOT_UUID\""# etc/rcS.conf
   3.845  	# set hostname.
   3.846  	log "$(gettext "Configuring host name:") $HOSTNAME"
   3.847 -	printf "$HOSTNAME\n" > etc/hostname
   3.848 -	printf "127.0.0.1	localhost $HOSTNAME tazpanel\n" > etc/hosts
   3.849 +	printf "%s\n" "$HOSTNAME" > etc/hostname
   3.850 +	printf "%s\n" "127.0.0.1	localhost $HOSTNAME tazpanel" > etc/hosts
   3.851  	cd "$path" || error8
   3.852  }
   3.853  
   3.854 @@ -1912,7 +1918,7 @@
   3.855  	cat > "$TARGET_ROOT/users.sh" << _EOF_
   3.856  #!/bin/sh
   3.857  umask 0022
   3.858 -echo "root:$ROOT_PWD" | chpasswd -m
   3.859 +printf "root:%s" "$ROOT_PWD" | chpasswd -m
   3.860  adduser -D -H $USER_LOGIN
   3.861  
   3.862  for grp in audio cdrom floppy dialout disk kmem tape tty video; do
   3.863 @@ -1921,7 +1927,7 @@
   3.864   fi
   3.865  done
   3.866  
   3.867 -echo "$USER_LOGIN:$USER_PWD" | chpasswd -m
   3.868 +printf "%s:%s" "$USER_LOGIN" "$USER_PWD" | chpasswd -m
   3.869  if [ ! -d /home/$USER_LOGIN ]; then
   3.870  	cp -a /etc/skel /home/$USER_LOGIN
   3.871  	[ -e /root/.xinitrc ] && cp /root/.xinitrc /home/$USER_LOGIN
   3.872 @@ -1972,7 +1978,7 @@
   3.873  		fi
   3.874  		# write entry in fstab, force uuid
   3.875  		uuid="$(dev2uuid "$HOME_UUID")"
   3.876 -		printf "$uuid /home $home_fs defaults \t0 \t2\n"	>> etc/fstab
   3.877 +		printf "%b\n" "$uuid /home $home_fs defaults \t0 \t2"	>> etc/fstab
   3.878  		umount home >> "$LOG" 2>> "$LOG"
   3.879  		cd "$path" || error8
   3.880  	fi
   3.881 @@ -2105,7 +2111,7 @@
   3.882  	do
   3.883  		if grep -q ^$pkg-[0-9] /var/lib/tazpkg/packages.list; then
   3.884  			packages="$(($packages+1))"
   3.885 -			echo "$pkg" >> packages-to-install.list
   3.886 +			printf "%s\n" "$pkg" >> packages-to-install.list
   3.887  		fi
   3.888  	done
   3.889  
   3.890 @@ -2148,9 +2154,9 @@
   3.891  		install_pkgs
   3.892  	else
   3.893  		touch packages-to-install.list
   3.894 -		printf "$(gettext "The list of available packages on the mirror could \
   3.895 -not be downloaded. No missing packages will be reinstalled now, but you can do \
   3.896 -so later by looking at the following list:
   3.897 +		printf "%s\n" "$(gettext "The list of available packages on the mirror \
   3.898 +could not be downloaded. No missing packages will be reinstalled now, but you \
   3.899 +can do so later by looking at the following list:
   3.900  /var/lib/tazinst/packages-selection.diff")"
   3.901  	fi
   3.902  	cd "$path" || error8
   3.903 @@ -2227,11 +2233,11 @@
   3.904  	clean)
   3.905  		clean "$2" ;;
   3.906  	version)
   3.907 -		echo "$VERSION" ;;
   3.908 +		printf "%s\n" "$VERSION" ;;
   3.909  	""|usage)
   3.910  		usage ;;
   3.911  	help)
   3.912  		help "$2" ;;
   3.913  	*)
   3.914 -		usage_error ;;
   3.915 +		usage_error "$1" ;;
   3.916  esac