I'd like to copy a file to a temporary location.
I'd like to make sure I'm not overwriting anything important, and that I know the location of the file while the script is running.
#!/bin/bash
myfile="$(mktemp)"
cp "source" "$myfile"
# work with $myfile
rm "$myfile"
Does this seem OK? Is there anything I'm missing? (Permissions, etc.?)
I have a bad feeling about overwriting that file.