From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17784 invoked from network); 28 Sep 2021 20:12:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Sep 2021 20:12:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1632859945; b=VZZp+tF2MyK5tf53l8YGzKbK5nWQ6x1E96MfTY7Xn3su419wy4m/yAThZWv9K3tsDoVZsEPEI1 p3Ft/U4QykBIHrIOBokItOC2q68LmsOMtCVHg9t300ldtAOTiN8QltY77zsQVDOmLqVK3XG2+8 8Z3AULFnB11eefR3crQlsANriM+CbgrBa7Q0f7PrLUObi9M7tnZiCZM9H/X1kjPx6KNQ8aDGdH IJW3JmL8d9gayfW0LUlk834HtqzW7yfzXlnMMYCZ//Vlb5ZvB2SeznSBPxY4X52OGxXWQ9rpeP dtTU0wR7NJsYCoTNHybFzmvoZuw6bZdDbAp79RYz2i4P9w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-il1-f174.google.com) smtp.remote-ip=209.85.166.174; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1632859945; bh=pqar40ZEf5P04vfsf710UJ7pqcF6WtKdqm8orMEWj7c=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=ixCDDO6pKGc65m80d92Dy12Bx2yCuSumfj7FH3eltcvhK+YXUNQrqkxmnorbSqBr7aHiRAAHE/ sU9lXRWlRR5YqPe01djJVV7dezE99jf2mF2ZcPQKDEaboKxgGv+VYhhUlQxmSEvEIL3wQ9nNrl 4UjYkB69RUc0I5jZzJ1zeaBMeS2LpSeEtzvBxi0tjEXV9UPzaaCudjjZcCzOXo44d913ewWKu0 N9KiiI5+qV/FgyOU909cqhuBX2dBYH+53cRXadmCrXW4NP6oNCPjx7cms8oy++Ty/pUUlm7sn7 ZskXsbwhsQalKzRvWTtQeJdYWX05v3mUD3Y+waxSSbW8rw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=nKtkYxCWbrO3bI9vMVspL+4KLRGbnYEEe7th056lx+k=; b=DBXnCnd38L9A7yvoH0TEWHxm+p z9fQcSF1Dm2qwtv2BGiPEu8BKKIp/OMP2y7vY864zwPDV4VjfmGW1GHTxx9UR09cwDHNhMnLo5MKw GlLdq8VIDjuAqYHnibJ7bLCaI5c9EhgUWtdxlfgJrszzp5PRWhyO+4Cs+Y1TqKMjGFuJRj4v9EHsw sfNsa8bQvtWOaq3A7LF/mxyc0LZlhrYks9/zMwGlVtVMReUqXsjf+j2xTHLkhlzexZ2Qj3BNCNw/s r25IRnCwisDwo612iLpvFAPuae/NxMXQjxPugy4MEzFVnP81NXPBDCSxT/Of53Ibmgd078rbBm75g ErAeP6Vg==; Received: from authenticated user by zero.zsh.org with local id 1mVJSj-0001TU-L9; Tue, 28 Sep 2021 20:12:25 +0000 Authentication-Results: zsh.org; iprev=pass (mail-il1-f174.google.com) smtp.remote-ip=209.85.166.174; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-il1-f174.google.com ([209.85.166.174]:45677) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mVJR3-0000FQ-UZ; Tue, 28 Sep 2021 20:10:42 +0000 Received: by mail-il1-f174.google.com with SMTP id y15so268424ilu.12 for ; Tue, 28 Sep 2021 13:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nKtkYxCWbrO3bI9vMVspL+4KLRGbnYEEe7th056lx+k=; b=Tx5P6pJ1O51XgVjakVKfugWYm+EstppzoBOVS4T3m2B5Mh8NWs8vEoqgLhdun5LOv/ W7HC/KLQrtVM+vVoAK/1URCPiEHTUkc6iD9qYJZO8ymogh9t45tGd/vRZNV3Qgfn+YdQ dksl6h8/on1VklsjpHHSYo1pJoh7PMkQRPqJj8T5JI8ohwfy8+A2DV9PQghGE2tATE01 M/0yiicaoF3rY5tSmJf8+U3Ye3EKZ9biS7gjQqPmqFrI9r/FrsNWmH2GrZsIGyD5VAWz NpS3Em0VlLxA1KH2lrRXx2SCSBpDT9ZcfcwqxZJEEAwQ6JKSCSFHz1JtDf+H5Xs9eBOk lhAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nKtkYxCWbrO3bI9vMVspL+4KLRGbnYEEe7th056lx+k=; b=bTpXnYhW4AZCJe4ijQooAENKIvYr8u0cadOUloL1cJhLhGG5d0NPkIwVYkTYCNonOw j52AzZlT2s8HAnNQ/REooOQCob5L4RXzNJR1qjKYUvsNyZYecIS/TqKl4kD8ZuE7JSPo 9B2g75pxVs2dix8VLc5tLc6rVVi5m3TJMCMPTIhEplN/jXZSfRqOS8+LufElYivIvbr0 TCeOBERjPGzHkacZA6769/T8sCw4BjLEoyXekxN6Rn2I65VMCrl2vFBvARiwzjVEgJeW tBJC5bVduDGkc/0xuwLwSjHsYsZJFi/TNDtbyhd/uWaVeT/16RFcH6vP+l3+AOzD+IiM oWVg== X-Gm-Message-State: AOAM531OgLt/IuE1xMLmdplTrATuChviUDxbkPArxupDbbKAJTchrMJs jXqz3d0coKfCr32kJfB7+uK20qM7AlC/5/mvllR0WoGgdpU= X-Google-Smtp-Source: ABdhPJxyBFXdyT1TQCnnhjuADWafKqoi4f5MrjwUirp1qT8qlLzQlMLpfG4rQ5V7mPWrFPlBqMfZv1arHHDWuv76qVM= X-Received: by 2002:a92:cdad:: with SMTP id g13mr5462169ild.103.1632859840928; Tue, 28 Sep 2021 13:10:40 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pier Paolo Grassi Date: Tue, 28 Sep 2021 22:10:04 +0200 Message-ID: Subject: Re: quoting words To: Marc Chantreux Cc: Zsh-Users List Content-Type: multipart/alternative; boundary="000000000000c9641d05cd13ce44" X-Seq: 27164 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --000000000000c9641d05cd13ce44 Content-Type: text/plain; charset="UTF-8" Hello, here is the output: 5.8 a isa array typeset -a omz=( 'the first' 'the last' ) 'the first' 'the last' the result from your script is in fact correct if I assign the "${(@qq)omz}": typeset -a omz=( 'the first' 'the last' ) a="${(@qq)omz}" typeset -p a typeset a='''the first'' ''the last''' regards Pier Paolo Grassi Il giorno mar 28 set 2021 alle ore 20:31 Marc Chantreux < mc@prometheus.u-strasbg.fr> ha scritto: > hello, > > echo $ZSH_VERSION > omz=( 'the first' 'the last' ) > echo a isa ${(t)omz} > typeset -p omz > echo -e "${(@qq)omz}" > > gives me > > 5.8 > a isa array > typeset -a omz=( 'the first' 'the last' ) > 'the first' 'the last' > > note the -a when you have > > typeset a='''sa bb'' ''cc dd''' > > so ${(t)omz} is probably scalar. would you mind unset a and give > my code a try ? > > regards > marc > > > --000000000000c9641d05cd13ce44 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello, here is the output:

5.8
a isa= array
typeset -a omz=3D( 'the first' 'the last' )
&#= 39;the first' 'the last'

the resul= t from your script is in fact correct if I assign the=C2=A0 "${(@qq)omz}":

typeset -a omz=3D( 'the fir= st' 'the last' )
a=3D"${(@qq)omz}"
typeset -p a= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
typeset = a=3D'''the first'' ''the last'''

regards

=
Pier Paolo Grassi


Il giorno mar 28 set 2021 alle = ore 20:31 Marc Chantreux <mc@prometheus.u-strasbg.fr> ha scritto:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">hello,

=C2=A0 =C2=A0 echo $ZSH_VERSION
=C2=A0 =C2=A0 omz=3D( 'the first' 'the last' )
=C2=A0 =C2=A0 echo a isa ${(t)omz}
=C2=A0 =C2=A0 typeset -p omz
=C2=A0 =C2=A0 echo -e "${(@qq)omz}"

gives me

=C2=A0 =C2=A0 5.8
=C2=A0 =C2=A0 a isa array
=C2=A0 =C2=A0 typeset -a omz=3D( 'the first' 'the last' ) =C2=A0 =C2=A0 'the first' 'the last'

note the -a when you have

=C2=A0 =C2=A0 typeset a=3D'''sa bb'' ''cc dd= 9;''

so ${(t)omz} is probably scalar. would you mind unset a and give
my code a try ?

regards
marc


--000000000000c9641d05cd13ce44--