Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
Create a temp file within the scope of a script(even the script crashes)
(opens in new tab)
(unix.stackexchange.com)
2 points
socrateslee
3y ago
1 comments
Save
Share
1 comments
1 comments · 1 top-level
top
newest
oldest
socrateslee
OP
3y ago
# create temporary file tldr: tmpfile=$(mktemp /tmp/abc-script.XXXXXX) exec 3>"$tmpfile" exec 4<"$tmpfile" rm "$tmpfile" # rest scripts
j
/
k
navigate · click thread line to collapse