Remove entry from array

To remove element number $i: a=("${(@)a[1,$i-1]}" "${(@)a[$i+1,$#a]}")

(The simpler construct a=($a[1,$i-1] $a[$i+1,-1]) also removes empty elements.)

ADDED:

To remove any occurence of b: a=("${(@)a:#b}")
:# is the hieroglyph to remove matching elements; "" and (@) is to operate correctly on arrays even if they contain empty elements.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)