Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
assigning part of the value of an element of an (associative) array
- X-seq: zsh-users 11050
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Zsh Users List <zsh-users@xxxxxxxxxx>
- Subject: assigning part of the value of an element of an (associative) array
- Date: Sun, 3 Dec 2006 23:10:11 +0000
- Mail-followup-to: Zsh Users List <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Sender: Stephane Chazelas <stephane_chazelas@xxxxxxxx>
Hi,
One can do:
print -r -- ${array[1][2]}
to get the second byte (character?) of the first element of
$array, or
first_byte=${mapfile[file.txt][1]}
One can also do:
scalar[1,3]="foo"
To assign parts of a scalar.
But how would you assign bytes 1 to 3 of $mapfile[file.txt] for
instance?
mapfile[file.txt][1,3]=foo
doesn't seem to work.
Thanks,
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author