aboutsummaryrefslogtreecommitdiff
path: root/bin/mkstemp
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-05-09 09:16:29 -0300
committerEuAndreh <eu@euandre.org>2024-05-09 09:16:29 -0300
commitcb3e6e922465717e360cedbe80f2420cc50e397d (patch)
treea0e2abd36b11acef9bf6e230a3f69843a0a59595 /bin/mkstemp
parentbin/backup: Further simplify this backup script (diff)
downloaddotfiles-cb3e6e922465717e360cedbe80f2420cc50e397d.tar.gz
dotfiles-cb3e6e922465717e360cedbe80f2420cc50e397d.tar.xz
bin/...: Move utilities to the dedicated "eut" package
Diffstat (limited to 'bin/mkstemp')
-rwxr-xr-xbin/mkstemp65
1 files changed, 0 insertions, 65 deletions
diff --git a/bin/mkstemp b/bin/mkstemp
deleted file mode 100755
index ec0d744..0000000
--- a/bin/mkstemp
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh
-set -eu
-
-usage() {
- cat <<-'EOF'
- Usage:
- mkstemp
- mkstemp -h
- EOF
-}
-
-help() {
- cat <<-'EOF'
-
-
- Options:
- -h, --help show this message
-
-
- Create a new temporary file and echo its name back.
-
-
- Examples:
-
- Capture output into temporary file:
-
- $ OUT="$(mkstemp)"; cmd > "$OUT"
- EOF
-}
-
-
-for flag in "$@"; do
- case "$flag" in
- (--)
- break
- ;;
- (--help)
- usage
- help
- exit
- ;;
- (*)
- ;;
- esac
-done
-
-while getopts 'h' flag; do
- case "$flag" in
- (h)
- usage
- help
- exit
- ;;
- (*)
- usage >&2
- exit 2
- ;;
- esac
-done
-shift $((OPTIND - 1))
-
-
-name="$(tmpname)"
-touch "$name"
-printf '%s\n' "$name"