标签: arrays bash shell filtering
我一般是Shell脚本的新手。我将需要为通配符字符串UCD*(*为通配符)过滤数组,并从数组alarmIDs中删除 all 所有这些元素。
UCD*
alarmIDs
#remove first element from array alarmIDs=("${alarmIDs[@]:1}") #now exlcude all strings starting with "UCD"
在shell脚本中这样做并保持原始数组名称alarmIDs(不创建新数组)的最佳方法是什么?