diff options
author | xyz <gky44px1999@gmail.com> | 2022-05-08 20:01:47 -0700 |
---|---|---|
committer | xyz <gky44px1999@gmail.com> | 2022-05-08 20:04:00 -0700 |
commit | 165a41a967d2221a5774865d0521be03ae766923 (patch) | |
tree | d8da0bca217761e431b36db40610be7e7b7df6de /home/xyz/.local | |
parent | 0be78fe77e33768ef8b78c56aa1cecea31af2b0a (diff) |
dateft, variable one extra , at the end instead of front seems better
Diffstat (limited to 'home/xyz/.local')
-rwxr-xr-x | home/xyz/.local/bin/dateft | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/home/xyz/.local/bin/dateft b/home/xyz/.local/bin/dateft index 8332dfb2..269cb7f0 100755 --- a/home/xyz/.local/bin/dateft +++ b/home/xyz/.local/bin/dateft @@ -6,10 +6,11 @@ while getopts cfF:t:T: opt; do c) tz_from="Asia/Shanghai";; f) tz_from="$(tzselect)";; F) tz_from="$OPTARG";; + # one extra ',' at the end will not let `for tz in ...` loop one extra time? t) for i in $(seq "$OPTARG"); do - tz_to="$tz_to,$(tzselect)" + tz_to="$(tzselect),$tz_to" done;; - T) tz_to="$OPTARG";; + T) tz_to="$OPTARG,$tz_to";; \?) exit 1;; esac done |