Finding the mountpoint of an device in shell scripts Looking for a correct and simple way to find a mountpoint in a shell script.
This working as expected
tmp=$(mktemp /tmp/my.XXXXXX)
mpoint=$(diskutil info -plist disk1s1 &gt;&quot;$tmp&quot; ; /usr/libexec/PlistBuddy -c 'Print MountPoint' &quot;$tmp&quot;)
rm -f &quot;$tmp&quot;

but it needs a temporary file.
While it isn't a big deal, but still would be nicer to do it without of the tempfile.
Unfortunately, the
/usr/libexec/PlistBuddy -c 'Print MountPoint' &lt;(diskutil info -plist disk1s1)

doesn't works.
It is a bug of the PlistBuddy or I missed something?
Using zsh in fresh Big Sur installation.
Use a here string to pass the output of diskutil to standard in.
/usr/libexec/PlistBuddy -c &quot;Print :MountPoint&quot; /dev/stdin &lt;&lt;&lt; &quot;$(diskutil info -plist disk1s1)&quot;