Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
prepend to array?
- X-seq: zsh-users 22754
- From: Anthony Heading <anthony@xxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: prepend to array?
- Date: Mon, 26 Jun 2017 22:43:10 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ajrh.net; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=6O9nC3fHMfZvNAcGb/0/aPFKf3oBeXjduP2cG2Kyyck=; b=G4Pia aswtDFq5nwpnGMMl892JlyOU/zu6xSUuHMuH0AUca73OVDl8MT3VVb7ThDlYZ6Ms RQYbVFJYLEi1CD/fiUrtfTgfsG6xdIrOkOsAJt2Po29R4oh4p6JKvtQCxgOSsX6L +SKD5hOjVFYrQq/40rTdemQVW63owzD4f3s1pE=
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=6O9nC3fHMfZvNAcGb/0/aPFKf3oBe XjduP2cG2Kyyck=; b=bAD1mPthFzU/OmEfEh66UfZiqkjQI4gGDyEUVplOW3r6z ivvxAuBI9TXw2qyMbBzKdxQ9yjYCx/XCbvSFcywaJUmwxl2pCfxfNw4t6ikC028m MFw528kSYEp7ahDooSNtUIuDKUrdKNIwgHsm4mUBDWIgDfdNxwaCnVMQ/UwZYBDi tnAorbIEbl+Yvi1H3BoBvHCxjn/xMNp15/UwfW6JBZ5rLu5r14F4PbWxlXZDeWxY HT8giUl73nHYRAP8JQUhG7/OSmizFXHb74SQrBPmRYMh/xibKNoqriMwOZ0mZ+uo QufW5aWJ8HAMP2kpneJ1fRx/N2t2PxjDYbZs6ldGw==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hi,
I've often found myself wanting to do this:
% zsh -c 'x=(a b c); x[0]+=(vip); echo $x'
zsh:1: x: assignment to invalid subscript range
I eventually realized I could write it this way instead:
% zsh -c 'x=(a b c); x[-999999]+=(vip); echo $x'
vip a b c
Is there any more elegant way to prepend?
Anthony
Messages sorted by:
Reverse Date,
Date,
Thread,
Author