summaryrefslogtreecommitdiff
path: root/home/xyz/.local/bin/f
diff options
context:
space:
mode:
Diffstat (limited to 'home/xyz/.local/bin/f')
-rwxr-xr-xhome/xyz/.local/bin/f23
1 files changed, 23 insertions, 0 deletions
diff --git a/home/xyz/.local/bin/f b/home/xyz/.local/bin/f
new file mode 100755
index 00000000..575f0a28
--- /dev/null
+++ b/home/xyz/.local/bin/f
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+while getopts t: opt; do
+ case $opt in
+ t) time="$OPTARG";;
+ \?) exit 1;;
+ esac
+done
+shift $((OPTIND-1))
+
+while :; do
+ # suggested by https://github.com/koalaman/shellcheck/wiki/SC2294
+ "$@"
+ sleep "${time:-1}"
+done
+
+# tests?
+#f ls -lah -- -l
+#f printf 'echo 1; echo 2'
+#f printf 'haha %d lala' 10
+
+# tips
+#f eval 'echo 1; echo 2'