Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Writing element number into element, of array
- X-seq: zsh-users 22544
- From: Sebastian Gniazdowski <psprint3@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Writing element number into element, of array
- Date: Mon, 06 Mar 2017 07:07:38 -0800
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.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= mesmtp; bh=6E7ef/KWQ9xisoxDfMdytRam31I=; b=iixhhavqY+cMqmllmY8DG 1hpGBCnvsLY2ngp2sYldV0Qng6X+MCXc4ON7B27H3Ad+yTmNKrclydzYipVGsW1s XGHjIGEB+qYl575+Yp16fnjnBirr7p4VR5cSTwXmTCPONeIlkuJK4mkNQ4MwQbQA 9pPwQ8n7KsAIE+StR1vndE=
- Dkim-signature: v=1; a=rsa-sha1; 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=smtpout; bh=6E7ef/KWQ9xisoxDfMdytRam3 1I=; b=GbxrAQCfiYm5Y//2ET66n49JwDJi7Sat4Fmw0/x3cjaYQHVirjmDV9gPY gR/tfyC/gmGZg8JrBHBLOSiRgPyXLrfL47UgwT7RWw5/9f0Ng+r/lfE5uzK+VZWp C1W9zgutEOu9xC7MkYtKXAsfApatWtM7TTIOT45B6AeMpqtL6w=
- 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
Hello,
# line=0
# arr=( "a" "ba" "x-LINE-x" "dcba" )
# echo ${arr[@]//(#b)(((*)-LINE-(*))|(*))/$match[3]$(( mend[2] != -1 ?
++ line : ( ++line, 0 ) ))$match[4]$match[5]}
$mend[2] is: ((*)-LINE-(*))
$match[3] is: first (*)
$match[4] is: second (*)
$match[5] is: |(*)
result:
0a 0ba x3x 0dcba
So this is quite close, "3" is written onto -LINE-, but I cannot get rid
of the "0". How can this be done?
--
Sebastian Gniazdowski
psprint3@xxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author