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
.
精彩评论