From ec17dd03e0b43e9e9f9b96fc7e6ed1072b7a9154 Mon Sep 17 00:00:00 2001 From: dteske Date: Sat, 22 Sep 2012 22:16:07 +0000 Subject: jilles accurately advises that, in the context of shell redirection, the `:' builtin is processed specially and thus the `: > file' syntax for example will cause premature termination of the current shell on redirection-error. The `true' builtin on the other-hand is not included in this special processing (for compatibility reasons to satisfy legacy scripts programmed for systems where `true' is not a builtin). Change bare `: > file' syntax into `true > file' syntax to prevent premature shell termination in the event of redirection-error. NOTE: Instances of `: > file' that appear within a sub-shell have been left unmodified as these will not cause premature termination of the main script. Reviewed by: jilles, adrian (co-mentor) Approved by: adrian (co-mentor) --- usr.sbin/bsdconfig/timezone/share/zones.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdconfig/timezone/share/zones.subr b/usr.sbin/bsdconfig/timezone/share/zones.subr index 874b272..81008a9 100644 --- a/usr.sbin/bsdconfig/timezone/share/zones.subr +++ b/usr.sbin/bsdconfig/timezone/share/zones.subr @@ -610,7 +610,7 @@ f_install_zoneinfo() # Save knowledge for later if [ "$REALLYDOIT" -a $rv -eq $SUCCESS ]; then - if : 2> /dev/null > "$_PATH_DB"; then + if true 2> /dev/null > "$_PATH_DB"; then cat <<-EOF > "$_PATH_DB" $zoneinfo EOF -- cgit v1.1