开发者

Bash script for /dev semi-mounted volume

开发者 https://www.devze.com 2023-01-08 16:22 出处:网络
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开发者_开发技巧\" co

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

精彩评论

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