Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Prepend to array



I have no idea where I came up with this but reading the internet and the documentation leads me to think that this isn’t really supported.

> # Add in my own functions
> fpath[1,0]=$ZDOTDIR/functions

It does exactly what I want: it prepends $ZDOTDIR/functions to the front of the fpath array.  I can’t even find an example where the 2nd index is less than the first index.

So, I thought I would ask:

1) Is the above syntax supported or does it just happen to work currently?

2) What is the prescribed method of prepending to an array: e.g.

Before
fpath=( /a/b /c/d )

After
fpath=( /x/y /a/b /c/d )

Thank you for your time,
Perry

Attachment: signature.asc
Description: Message signed with OpenPGP



Messages sorted by: Reverse Date, Date, Thread, Author