From 27f6582115ac466e02c7926291fd6f0d6c7f7a3b Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sat, 1 Jul 2023 15:21:02 -0700 Subject: update --- home/xyz/.local/bin/o | 2 ++ 1 file changed, 2 insertions(+) (limited to 'home/xyz/.local/bin') diff --git a/home/xyz/.local/bin/o b/home/xyz/.local/bin/o index d70a6d76..8fb066c7 100755 --- a/home/xyz/.local/bin/o +++ b/home/xyz/.local/bin/o @@ -13,6 +13,8 @@ # using `>&-` or `2>&-` doesn't completely close mpv's output when run sth. like `o mpv file.mkv` # base on above observations, I choose to use `>/dev/null 2>&1` instead +# need ; before } when it is in the same line as { ? https://www.shellcheck.net/wiki/SC1056 + if [ $# -eq 1 ] && [ -e "$1" ] && { ! [ -x "$1" ] || [ -d "$1" ];}; then case "$1" in # libreoffice, please don't let firefox eat your shit -- cgit v1.2.3-70-g09d2 ref='/'>cgit logo index : config_local_arch
Device dependent config files for Arch Linux, managed by https://git.flylightning.xyz/fsh/tree/sh/cfg (git bare repo method)
summaryrefslogtreecommitdiff
path: root/home/xyz/.local/bin/dateft
blob: b3174749f8a9c8e85a7cbb4ffe1e8fc2b12fd516 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# DATE From To

while getopts cfF:t:T: opt; do
	case $opt in
		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="$(tzselect),$tz_to"
			done;;
		T) tz_to="$OPTARG,$tz_to";;
		\?) exit 1;;
	esac
done
shift $((OPTIND-1))