Correct. The quoting
prevents reinterpretation of all special characters within the quoted string, except $, ` (backquote), and \ (escape) (cited from the Advanced Bash Scripting Guide). So the ~ in ~/tmp is not expanded and when passed to the mktemp command the variable substitution is performed with no possibility for the tilde expansion (due to the order of the expansion as explained above).
Of course, this behaviour is common to all the commands (not specific to mktemp). For example, consider the following:
Code:
$ pwd
/home/colucix/test
$ my_dir="~"
$ cd $my_dir
bash: cd: ~: No such file or directory
$ pwd
/home/colucix/test
$ my_dir=~
$ cd $my_dir
$ pwd
/home/colucix