Introduction
Introduction Statistics Contact Development Disclaimer Help
fail early if creating a temporary file failed - json2tsv - JSON to TSV convert…
git clone git://git.codemadness.org/json2tsv
Log
Files
Refs
README
LICENSE
---
commit 994b5ebefdc81372822b42917e254ee1b0728db0
parent 6bc2f0c4a81a8b4877385d396fac72e931a90e30
Author: Hiltjo Posthuma <[email protected]>
Date: Sun, 23 Apr 2023 12:22:51 +0200
fail early if creating a temporary file failed
Diffstat:
M jaq | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/jaq b/jaq
@@ -12,7 +12,7 @@ fi
expr="$*"
# POSIX way to simulate -o pipefail if JSON data is invalid.
-statusfile=$(mktemp)
+statusfile="$(mktemp)" || exit 1
trap -- "rm -f \"${statusfile}\"" "EXIT"
{ json2tsv ${nflag} -r -F '\x1f' -R '\x1e'; echo $? >"${statusfile}"; } | \
LC_ALL=C awk "BEGIN { FS = \"\x1f\"; RS = \"\x1e\" }${expr}"
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.