Create temp files

#!/bin/bash

trap 'rm -f "$TMPFILE"' EXIT

TMPFILE=$(mktemp) || exit 1
echo "Our temp file is $TMPFILE"

Ref: http://www.ruanyifeng.com/blog/2019/12/mktemp.html

https://wangdoc.com/bash/mktemp.html

Last updated