aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2023-04-07 12:46:42 +0800
committerHsieh Chin Fan <pham@topo.tw>2023-04-07 12:46:42 +0800
commit52af58e39af8ac006c62d1788b6672966b2a9f47 (patch)
treea07e147eb4d3c2af1e3da5e5fc32ca1f04e9e5b0 /bin
parent204f6a6a7024a2744fe948b1014494ebc2fd3a56 (diff)
Update
Diffstat (limited to 'bin')
-rwxr-xr-xbin/task/context2
-rwxr-xr-xbin/unix/timer.sh2
2 files changed, 3 insertions, 1 deletions
diff --git a/bin/task/context b/bin/task/context
index 76e1984..75597b3 100755
--- a/bin/task/context
+++ b/bin/task/context
@@ -18,7 +18,7 @@ if [ -n "$1" ]; then
18 fi 18 fi
19 done <$LOG_FILE 19 done <$LOG_FILE
20 if [ "$update" = true ]; then 20 if [ "$update" = true ]; then
21 sed -i -E "s/^$context.*/$context\t$summary" $LOG_FILE 21 sed -i -E "s/^$context.*/$context\t$summary/" $LOG_FILE
22 else 22 else
23 echo -e "$context\t$count" >>$LOG_FILE 23 echo -e "$context\t$count" >>$LOG_FILE
24 fi 24 fi
diff --git a/bin/unix/timer.sh b/bin/unix/timer.sh
index b4f48c5..b7f941e 100755
--- a/bin/unix/timer.sh
+++ b/bin/unix/timer.sh
@@ -8,6 +8,8 @@ SIGNAL=${1:-SIGTERM}
8COMMAND_START="$2" 8COMMAND_START="$2"
9COMMAND_EXIT="$3" 9COMMAND_EXIT="$3"
10 10
11[ -n "$COLOR" ] && echo -en "\e[${COLOR}m"
12
11# If SIGNAL is received, switch to next display 13# If SIGNAL is received, switch to next display
12trap 'next_display' "$SIGNAL" 14trap 'next_display' "$SIGNAL"
13# Use SIGTSTP (Ctrl-Z in most of the cases) to stop/restart timer 15# Use SIGTSTP (Ctrl-Z in most of the cases) to stop/restart timer