这是我的shell脚本
#!/bin/bash
d="${HOME}/image-dir"
# Expanding to /Users/napoleon/image-dir
d1="~/image-dir"
# Expands to ~/image-dir
also in the command line
echo "~" # output is ~
echo ~ # output is "/Users/napoleon"
有人可以解释这背后的原因吗?是否按照手册工作
这个问题的目的是了解为什么波浪号不能在双引号“~”内工作。