From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yBEfG1JOaWDBXAAAgWs5BA (envelope-from ) for ; Sun, 04 Apr 2021 07:27:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id uI7+FFJOaWCULQAAbx9fmQ (envelope-from ) for ; Sun, 04 Apr 2021 05:27:46 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B6B971366B for ; Sun, 4 Apr 2021 07:27:45 +0200 (CEST) Received: from localhost ([::1]:59450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSvIV-0004lP-7g for larch@yhetil.org; Sun, 04 Apr 2021 01:27:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSvHu-0004lF-BZ for emacs-orgmode@gnu.org; Sun, 04 Apr 2021 01:27:06 -0400 Received: from mout.gmx.net ([212.227.15.19]:56427) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSvHp-0006TB-24 for emacs-orgmode@gnu.org; Sun, 04 Apr 2021 01:27:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1617514017; bh=bUDlHgG3BxtveZnI9qfZ1/57nsVD7ZGGfsChiftMKJI=; h=X-UI-Sender-Class:From:To:Subject:In-Reply-To:References:Date; b=lsfWNscFfcxjdXo1rdadnPv0EG4RMYvBcrHNUYjPiim2JcGtH+Ew1cGtlv815fdtH 7sveQTjKRQ6WZhhUoOeWAb4tcYfM2kmj/orm7Y9cPNK+1Zs58/fEONHx7qsH1vuaXj dhIrBnUXp84Nc0h75e3CgvArMkrxHG+WUKPidHbU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from stella.c0t0d0s0.de ([46.114.152.160]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MMofW-1lCLq90kdQ-00IpZa for ; Sun, 04 Apr 2021 07:26:57 +0200 Received: from stella (stella.c0t0d0s0.de [192.168.42.1]) by stella.c0t0d0s0.de (Postfix) with ESMTP id 3A847180E22 for ; Sun, 4 Apr 2021 07:26:53 +0200 (CEST) From: Michael Welle To: emacs-orgmode@gnu.org Subject: Re: How to get a table into a variable in a shell code block? In-Reply-To: (William Denton's message of "Sat, 3 Apr 2021 14:57:54 -0400 (EDT)") References: <700587.1617475549@apollo2.minshall.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sun, 04 Apr 2021 07:26:53 +0200 Message-ID: <878s5yr55u.fsf@luisa.c0t0d0s0.de> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Q2vgBisjSdn9ZHQyNXK+ckP4TwasHrIqKaPTo/guqiE3klWyBtr XA/LcuugQ9NbtHCuSmpUzMqeOn2rFD3ssTrZCegcdmxz1jFYwPt3WuwqnPeeriNowzZuA+A yQGRLT+7bfjiRtJCqL50r++oRNDl5xAwULpqfFxSSCNEPIslpSpc4OdBbxOQZ78g0Q8xONb H8a0j4y1RgKnBRsdxdk4g== X-UI-Out-Filterresults: notjunk:1;V03:K0:MS1jFGXEAWE=:4VPaTYzdd5DbuVGL7Zn1o/ Ev+lbiK6+P7MOqkr1ddG9loFMej08PO31AOoUWT8rdSuDHGYcak0uBQcE6v6VU/Ef13e/p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ZCDMJ4BMaErUOsOHQKhPCqG11UrPJ/ 25NdvMBSAib8NPUPJfeknaAO/IW3/e2p8KWDzoohVYsDabyAR8z2a+QHtJey9xRvAoGw0= Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=212.227.15.19; envelope-from=mwe012008@gmx.net; helo=mout.gmx.net X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617514066; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=PvTtu1CEPcDEtebSZm9y7gNf3dxMYL8Rs3nieBef7ao=; b=C7ayldFhJC4l6lnLowSP40Dlb7u8Rv2dhH5XKOf5GEN/ubrAp8aMekY0vUOcs758HTh/e4 3g/WjMjoLAA3rH9szbTN/FIFlf6MiocoJfKQ+SD0vTD4u4KBTKPE3+cp3jUnnfAF2vbHAj XUfvH3yhs9NT53XC40QH3M9BRZ/akPkHHfIfcUq/AV9ALXgsm8/kOtIGB8cM7J4XDhNnSB s/gTIYGpsptoX6VH9u6MrGkl1w7A1fy8FJwcB7ctOGy/uZfuO6zACFbjdkxDGFqiLMFO/A pYIuMzxniI3U48Ezzip8RwXv7T/fL1E3IQACC/xnmfQn3fxoKvCw8eg859Ms5Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617514066; a=rsa-sha256; cv=none; b=Sw7W8sKF2C9EnrOk7sPLsZbNcukyvekMogZHpriB3upYnvZYcSk0fYhASs1NIqgKdtG1UC rUbVkte+wo/hUMxTUs6umOFVTI4NK/59nOZHHrZ46WCryU/9c1bDpzemaxoEfwSQYgfhYc VG/Jfd1m8O0vgiRrYRklvzUb8Fg7InOpgOJeAQ8gXPazFLdnmcAZQ3rvw0t0zWB4xPbyOn QIW5D3vycQzad+VNcoil9JNrl6tJLmJOQcKXFnKUgQfL7ajJa98t7h62RpJ0TJD399Xv76 a/5EJeE6MgJ4KgY906OGbaaxTDWt81n+JKgLfSjLF69nUdXBD4mIVs3mbFZ71w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=lsfWNscF; dmarc=pass (policy=none) header.from=gmx.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: 0.36 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=lsfWNscF; dmarc=pass (policy=none) header.from=gmx.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: B6B971366B X-Spam-Score: 0.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: ciaqUi+QVQNB Hello, William Denton writes: > On 3 April 2021, Greg Minshall wrote: > >> #+begin_src shell :results output :var n=3Dnumbers >> echo ${n[1]} >> #+end_src > > Aha, it's in an array but I didn't see it! Thanks. Org was doing it ma= gic but > I got confused by bash. interestingly I asked a similar question in #org-mode yesterday. I came up with this approach: * table test ** user data #+name: userdata | uid | name | foo | bar | | a2s | a2 | afoo | abar | | b2s | b2 | bfoo | bbar | | c2s | c2 | c foo | cbar | ** code #+begin_src sh :var userdata=3Duserdata :separator , :results raw echo "$userdata" | while read line ; do IFS=3D',' echo "$line" | while read u n f b ; do echo "u: $u n: $n f: $f b: $b" done done #+end_src This looks a bit clumsy, but should also work with shell that doesn't support (2D) array type variables. Regards hmw