shell遍历数组
2021-09-21 23:13
标签:字符 空字符串 遍历数组 form xxx The file one 遍历 JUMP_XCX=(‘xxx_111‘ ‘yyy_222‘ ‘zzz_333‘) if [[ $JUMP_XCX != ‘‘ ]]; then # 可以判断空字符串 和 空数组 NEW_JUMP_XCX=‘‘ for v in ${JUMP_XCX[@]};do if [[ $NEW_JUMP_XCX = ‘‘ ]];then NEW_JUMP_XCX+="‘$v‘" else NEW_JUMP_XCX+=",‘$v‘" fi done sed -i "s#^\$jump_xcx.*;#\$jump_xcx=[${NEW_JUMP_XCX}];#g" $uniform_file fi 处理成php数组 $jump_xcx=[‘xxx_111‘,‘yyy_222‘,‘zzz_333‘]; 什么数组不数组的,本质都是字符串。shell遍历数组标签:字符 空字符串 遍历数组 form xxx The file one 遍历 原文地址:https://www.cnblogs.com/jiqing9006/p/13167632.html
上一篇:C# 协变与逆变