Create a temp file within the scope of a script(even the script crashes)unix.stackexchange.com 2 pointssocrateslee3 years ago1 commentSaveHideCopy link On HNComments−socratesleeOP3y# create temporary file tldr: tmpfile=$(mktemp /tmp/abc-script.XXXXXX) exec 3>"$tmpfile" exec 4<"$tmpfile" rm "$tmpfile" # rest scripts
Comments
# create temporary file tldr: tmpfile=$(mktemp /tmp/abc-script.XXXXXX) exec 3>"$tmpfile" exec 4<"$tmpfile" rm "$tmpfile" # rest scripts