單項選擇題在shell腳本中,下面哪種方法可以獲得字符串變量string的長度?()

A.#{$string}
B.${#string}
C.${$string}
D.#{#string}


您可能感興趣的試卷

你可能感興趣的試題

1.單項選擇題在shell腳本中,good是已知變量,下面哪種方法不可以實現(xiàn)字符串的拼接賦值?()

A.txt="I am "$good"vegetable!"
B.txt="I am ${good}vegetable!"
C.txt=’I am ’$good’vegetable!’
D.txt=’I am ${good}vegetable!’

5.單項選擇題在shell腳本中,下面哪些方法可以只顯示變量fenghuo里的值?()

A.echo fenghuo
B.cat $fenghuo
C.echo ${fenghuo}
D.echo {$fenghuo}