shell array

 

 

#!/bin/bash
names=(Jerry Alice David Wendy "Tom"isTeach)
var=\"Tom\"
echo "原始数组= ${names[*]}"
# 查找value 是否存在array 当中
[[ ${names[
*] /$var/} != ${names[*]} ]] && echo 'yes' || echo 'no' if [[ ${names[*] /$var/} != ${names[*]} ]]; then echo true else echo false fi

 

posted @ 2020-12-25 11:47  linbo.yang  阅读(144)  评论(0编辑  收藏  举报