#!/bin/bash # Verify one parameter if [[ $# != 1 ]]; then echo Usage: "'rd_label '" exit 1 fi # Read the label lbl=$(dd bs=1 skip=32808 count=32 if=$1 2>/dev/null) if [[ $? != 0 ]]; then echo Couldn\'t get CD label! exit 1 fi # Trim trailing blanks lbl=$(echo $lbl | sed 's/ *$//') echo $lbl