前端之家收集整理的这篇文章主要介绍了
bash – 如何测试给定的路径是否为安装点,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
假设你想测试/ mnt / disk是否为shell脚本中的安装点。
你怎么做到这一点?
我发现在我的Fedora 7有一个mountpoint命令。
从man mountpoint:@H_301_7@
NAME
mountpoint - see if a directory is a mountpoint
SYNOPSIS
/bin/mountpoint [-q] [-d] /path/to/directory
/bin/mountpoint -x /dev/device
显然它带有sysvinit包,我不知道这个命令是否可用于其他系统。@H_301_7@
[root@myhost~]# rpm -qf $(which mountpoint)
sysvinit-2.86-17