diff --git a/gensign b/gensign index a7fa7c1..ce322f4 100755 --- a/gensign +++ b/gensign @@ -1,7 +1,6 @@ #!/bin/bash #echo "Kryštof Pešek" > /home/kof/.signature #echo "https://k0f.github.io" >> /home/kof/.signature -#echo "https://k0f.github.io" >> /home/kof/.signature #echo "-----------------------------------------" >> /home/kof/.signature #echo Moon phase : `/home/kof/bin/moonphase` >> /home/kof/.signature #echo Metric time: `/home/kof/bin/metriclock` >> /home/kof/.signature @@ -10,7 +9,7 @@ while true; do { echo "Kryštof Pešek" - echo "https://k0f.github.io" + #echo "https://k0f.github.io" echo "-----------------------------------------" echo "Moon phase : $(/home/kof/bin/moonphase)" #echo "Metric time : $(/home/kof/bin/metriclock)" diff --git a/now b/now index 75915d6..fc65ef8 100755 --- a/now +++ b/now @@ -1,10 +1,15 @@ #!/bin/bash -# Check if the first argument starts with [ and ends with ] -if [[ "$1" =~ ^\[.*\]$ ]]; then - CATEGORY="${1^^}" # Uppercase the tag - shift # Remove the category from the argument list - ARGS="$*" # The rest of the message +# Check if category tag is provided, e.g. [TAG] or "[TAG] message" +if [[ "$1" =~ ^\[([^]]+)\][[:space:]]*(.*)$ ]]; then + CATEGORY="${BASH_REMATCH[1]^^}" + REST="${BASH_REMATCH[2]}" + shift + if [ -n "$REST" ]; then + ARGS="$REST${*:+ }$*" + else + ARGS="$*" + fi else CATEGORY="GENERAL" ARGS="$*"