Un truc genre ça (j'ai eu la flemme de copier les parties pas intéressantes):
i=0
echo "Select the DVD device you would like to use:"
for udi in $(hal-find-by-property --key storage.drive_type --string cdrom); do
if [ "$(hal-get-property --key storage.cdrom.dvd --udi $udi)" = "true" ]; then
DvdDevice[$i]=$(hal-get-property --udi $udi --key block.device)
echo "$i) ${DvdDevice[$i]} ($(hal-get-property --udi $udi --key storage.model))"
let i=i+1
fi
done
read DvdDeviceChoice
# Hal
Posté par Pascal Terjan . En réponse au message Liste des périphériques. Évalué à 3.
i=0 echo "Select the DVD device you would like to use:" for udi in $(hal-find-by-property --key storage.drive_type --string cdrom); do if [ "$(hal-get-property --key storage.cdrom.dvd --udi $udi)" = "true" ]; then DvdDevice[$i]=$(hal-get-property --udi $udi --key block.device) echo "$i) ${DvdDevice[$i]} ($(hal-get-property --udi $udi --key storage.model))" let i=i+1 fi done read DvdDeviceChoice