Saturday, 4 February 2017

get only the option value in shell script option

What does i#*= mean in the following shell script snippet?

case $i in
        --flags=*)
            FLAGS="$FLAGS${i#*=} "


Here it means attach  the part after symbol '=' of $i to FLAGS.

For example, Let us assume $i is --flags=BBB  if originally FLAGS='AAA ' before executing this line,  after execution, it would become   FLAGS='AAA BBB '

No comments:

Post a Comment