bash temporary file
## You can use 'mktemp' ## Storing filename in a variable ## The X is replaced by random string tmpfile=$(mktemp /tmp/abc-script.XXXXXX)
linux bash temporary file
temp_file=$(mktemp) # do something with the file rm ${temp_file}
Source: unix.stackexchange.com
bash temporary files
# The next line will create a temporary file and return its path. path="$(mktemp)" echo "Hello, World!" > "$path"