From 82a14304574b6501665018d528e8f4bd1e82a60b Mon Sep 17 00:00:00 2001 From: Sam Sarette Date: Tue, 11 Jun 2024 13:05:56 -0400 Subject: [PATCH] fix more things macOS doesn't support because its bash version is ancient --- script-dialog.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/script-dialog.sh b/script-dialog.sh index ca8b06f..6c7f733 100755 --- a/script-dialog.sh +++ b/script-dialog.sh @@ -133,7 +133,7 @@ else fi # Handle when read command doesn't support default text option -if read -i "test" <<< echo "test" >/dev/null; then +if echo "test" | read -i "test" 2>/dev/null; then NO_READ_DEFAULT="" fi @@ -1230,10 +1230,13 @@ function datepicker() { fi _calculate-gui-title - NOW=$( printf '%(%d/%m/%Y)T' ) - DAY=$( printf '%(%d)T' ) - MONTH=$( printf '%(%m)T' ) - YEAR=$( printf '%(%Yd)T' ) + NOW="31/12/2024" + if [ ! -z ${NO_READ_DEFAULT+x} ]; then + NOW=$( printf '%(%d/%m/%Y)T' ) + fi + DAY=0 + MONTH=0 + YEAR=0 if [ "$INTERFACE" == "whiptail" ]; then local SYMBOL=$CALENDAR_SYMBOL