kennyevo
kennyevo

Reputation: 683

Value not assigned to variable in shell script

I don't know what I do wrong, but this code just doesn't work for me:

mode="-P"
select mmode in "default" "fast"; do
    case $mmode in
        default ) break;;
        fast ) mode="-T 2C -P" break;;
    esac
done

echo $mode

The output is always "-P". Somebody please tell me where's the problem, thank you in advance!

Upvotes: 2

Views: 181

Answers (1)

devnull
devnull

Reputation: 123498

A missing ; causes it. Say:

fast ) mode="-T 2C -P"; break;;

Upvotes: 3

Related Questions