I have some shell scripts that need to access paths under /Volumes/
e.g. /Volumes/MyDisk/tmp/foo.json
. Right now the scripts have hardcoded volume names. I would like to make them portable so they run correctly on my various machines, all of which have different disk names for the boot volume.
Can anyone post a reliable method for getting the disk name of the system on a modern macOS system? (13.0.1 as of this writing)
/
? For the system volume, all that's under/Volumes
is a symbolic link to that anyway (runls -l /Volumes
to see what I mean)./Volumes
@GordonDavisson/
will always be the system volume. That is,/Volumes/WhateverTheStartupVolumeIs/path/to/some/file
is equivalent to just/path/to/some/file
. So why bother with the/Volumes/WhateverTheStartupVolumeIs
part?/
— you must use a prefix like/Volumes/volName/...