From ea2a3600f1b8b432c2a1f3adaf873982e9fa489b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 19 Jan 2024 18:07:43 -0800 Subject: Improve initialization. * cdlog.sh (toplevel): Ensure that c1 exists, so that the init code doesn't access a nonexistent c1. Condense the assignments in the init block. --- cdlog.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cdlog.sh b/cdlog.sh index 911c606..75b1e01 100644 --- a/cdlog.sh +++ b/cdlog.sh @@ -1,15 +1,13 @@ # License at bottom. # Initialize cdlog the first time. + +c1=${c1-} + if [ -z "$c1" ] ; then - c9= - c8= - c7= - c6= - c5= - c4= - c3= - c2= + c9=; c8=; c7= + c6=; c5=; c4= + c3=; c2= fi # One-letter nicknames for most recent four dirs. -- cgit v1.2.3