zsh-users
 help / color / mirror / code / Atom feed
* indirect assignment to array
@ 2020-04-15 23:01 Pier Paolo Grassi
  2020-04-15 23:13 ` Mikael Magnusson
  0 siblings, 1 reply; 15+ messages in thread
From: Pier Paolo Grassi @ 2020-04-15 23:01 UTC (permalink / raw)
  To: Zsh-Users List

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

Hello, I'm trying to assign the content of an array to another which name
is contained in a variable
What I tried:

varname=newarray
typeset -a array=(1 2 3)
typeset -a $varname=($array)

but I get an
zsh: bad pattern: newarray=(1

are there other methods to do indirect assignment that allow me to do this?

thanks

Pier Paolo Grassi

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-04-16 21:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 23:01 indirect assignment to array Pier Paolo Grassi
2020-04-15 23:13 ` Mikael Magnusson
2020-04-15 23:42   ` Pier Paolo Grassi
2020-04-15 23:54     ` Bart Schaefer
2020-04-16  0:05       ` Pier Paolo Grassi
2020-04-16  0:12         ` Bart Schaefer
2020-04-16 16:02           ` Pier Paolo Grassi
2020-04-16 16:28   ` Sebastian Gniazdowski
2020-04-16 18:04     ` Pier Paolo Grassi
     [not found]     ` <CAP+y1xDa=fUvaP=gwbawRmcfwjq0ZH1KEnt=wTX4zOKaT4mzyQ__13411.9792653777$1587060411$gmane$org@mail.gmail.com>
2020-04-16 20:24       ` read -r and bad surprises (Was: indirect assignment to array) Stephane Chazelas
2020-04-16 21:06         ` Pier Paolo Grassi
     [not found]   ` <CAP+y1xAG3ayQNE3JqeF_YOT5FZ9pLiUAF5TmPVoOv+nPyjK30A__22203.4378488146$1586994256$gmane$org@mail.gmail.com>
2020-04-16 16:30     ` indirect assignment to array Stephane Chazelas
2020-04-16 16:37       ` Pier Paolo Grassi
2020-04-16 17:37         ` Bart Schaefer
2020-04-16 17:43           ` Pier Paolo Grassi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).