2017-06-07 7 views
0

私はmacOS用のスクリプトを作成しようとしており、ユーザはシステムがインストールされているボリュームを選択する必要があります。問題は、ボリューム名が機能していないことです(有効なインストールではありません)。現在、このように見えます。Bash User Select Volume

# Ask the user what drive macOS is installed on 
while [ ! -e /Volumes/$VOLUME/boot ]; do 
    printf "\nPlease enter the name of the disk macOS is installed on (Leave blank to exit):\n" 
    read VOLUME 
    if [ -z $VOLUME ]; then #if no value was entered 
     exit 1 
    fi 
    if [ -e /Volumes/$VOLUME/boot ]; then 
     break 
    else 
     printf "\nNot a valid install!\n" 
    fi 
done 

どこが間違っていましたか?

ありがとうございました。

+0

あなたは 'lsの-l /ボリューム/ */boot'の結果を示すことができますか? –

答えて

0

これを修正することができました。この、これに

if [ -e /Volumes/$VOLUME/boot ]; then 

を変更し、

if [ -e /Volumes/$VOLUME ]; then