1

how can i remove an element from an array completely?

view story
linux-howto

http://unix.stackexchange.com – unset array[0] removes the element but still if i do echo ${array[0]} i get a null value moreover there are other ways of doing this but if an element of an array conatins spaces like below array[0]='james young' array[1]='mary' array[2]='randy orton' but these also fail to do the job array=${array[@]:1} #removed the 1st element now i want the new array to be like array[0]='mary' array[1]='randy orton' The spaces cause the trouble after assignment and the actual array becomes like with substitution. array=(mary randy orton) (HowTos)