开发者

Bash script for /dev semi-mounted volume

I am trying to write a bash script to automatically mount a volume that is in /dev (EC2 EBS storage). When the device is connected, it shows up as /dev/sdf (always)...but the "find开发者_开发技巧" command does not work on it when it is there (just not technically mounted in /etc/mtab).

These do not work:

[ -f /dev/sdf ] && echo "It exists" || echo "It does not exist"

[ -d /dev/sdf ] && echo "It exists" || echo "It does not exist"

What am I missing?


You want -b. See help test.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜