Pattern: Use of deprecated tempfile
Issue: -
tempfile
is a Debian specific utility for creating temporary files. Its man page notes:
tempfile is deprecated; you should use mktemp(1) instead.
Neither tempfile
nor mktemp
are POSIX, but tempfile
is Debian specific while mktemp
works on GNU, OSX, BusyBox, *BSD and Solaris.
Example of incorrect code:
tmp=$(tempfile)
Example of correct code:
tmp=$(mktemp)
ShellCheck will not recognize when a function overrides this name.