zsh, et les tableaux

oui ... c'est vrai, perl a shift, unshift, pop et push ...

mais en zsh on a la meme en utilisant les sous-tableaux:

a=( this is a )
 
# pop
a[-1]=()
 
# push 
a[-1]=( $a[-1]  test )
 
# shift 
a[1]=()
 
# unshift
a[1]=( yeah, $a[1] )

Poster un nouveau commentaire

Le contenu de ce champ ne sera pas montré publiquement.
  • You can use BBCode tags in the text.
  • Les lignes et les paragraphes vont à la ligne automatiquement.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".

Plus d'informations sur les options de formatage