How to test if a given path is a mount point

后端 未结 10 828
-上瘾入骨i
-上瘾入骨i 2021-01-31 08:41

Suppose do you want test if /mnt/disk is a mount point in a shell script. How do you do this?

10条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 09:01

    df $path_in_question | grep " $path_in_question$"
    

    This will set $? upon completion.

提交回复
热议问题