Read the title from a DVD?
You could use blkid
for that:
DVD_NAME=$(blkid -o value -s LABEL /dev/dvd)
(you need to have read permission to /dev/dvd
for that).
Or:
DVD_NAME=$(udevadm info -n dvd -q property | sed -n 's/^ID_FS_LABEL=//p')
for which you don't need any special privilege (udev
(running as root) queries the label name using blkid
and updates a device database which you query with udevadm
).