我无法让IFS根据冒号分隔符正确拆分字符串。似乎字符串中的-e
被视为一个选项,而不是被视为文字字符串。
#!/bin/bash
string_val="-e:SQA"
IFS=: read -a items <<< "$string_val"
echo "${items[0]}" # Prints empty value
echo "${items[1]}" # Prints SQA
如何解决这个问题?
答案 0 :(得分:1)
正确拆分字符串; var thetext='';
.getText('//span[@class="price"]' ,fucntion(result){
thetext=result.value();
})
中的-e
被视为${items[0]}
的选项。
echo