fix shellcheck errors in 1993/dgibson/dgibson.sh

This commit is contained in:
Landon Curt Noll committed 2024-03-11 00:37:48 -07:00
1 parent db1e83918b
commit 1004b0b773
1 file changed
+5 -5
+5 -5
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env bash
# #
# dgibson.sh - run the IOCCC entry 1993/dgibson # dgibson.sh - run the IOCCC entry 1993/dgibson
# #
@@ -7,23 +7,23 @@
# parse args # parse args
# #
if [ $# -eq 0 ]; then if [[ $# -eq 0 ]]; then
DATA="./dgibson.data1" DATA="./dgibson.data1"
else else
DATA="$1" DATA="$1"
fi fi
if [ ! -f "$DATA" ]; then if [[ ! -f "$DATA" ]]; then
echo "$0: no data found in $DATA" 1>&2 echo "$0: no data found in $DATA" 1>&2
exit 1 exit 1
fi fi
# for the initial data.name if needed # for the initial data.name if needed
# #
if [ ! -f "data.name" ]; then if [[ ! -f "data.name" ]]; then
rm -f data.name rm -f data.name
echo "$DATA" > data.name echo "$DATA" > data.name
fi fi
if [ ! -f life.d ]; then if [[ ! -f life.d ]]; then
# force a new life setup # force a new life setup
echo "/" > data.name echo "/" > data.name
fi fi