Bash only expands a ~ if it's the beginning of a word. You can see this between the following commands:
確定! 回上一頁