在 mount ntfs-3g 指令中使用變數

在 mount ntfs-3g 指令中使用變數

當我不使用變數時,這是有效的:

sudo mount -t ntfs-3g /dev/sdc1 /mydirectory/tools

當我想將分區名稱和目錄路徑名放入變數中:

diskName="/dev/sdc1"
pathName="/mydirectory/tools"

sudo mount -t ntfs-3g $diskName $pathName

它產生錯誤:

mount: can't find /mydirectory/tools in /etc/fstab

我究竟做錯了什麼?我應該怎麼做才能將磁碟名稱和目錄路徑放入變數中並與 mount 命令一起使用?

相關內容