Comment 5 for bug 430542

Revision history for this message
Lars Volker (lv) wrote :

This does the trick in bash, but *not* in sh/dash:

DM_NAME=ubuntu--vg-ubuntu--lv
t=${DM_NAME//--/_}
vg=${t%-*}; vg=${vg/_/-}
lv=${t#*-}; lv=${lv/_/-}
echo "/dev/$vg/$lv"