From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4Pz1CdWwaGBfigAAgWs5BA (envelope-from ) for ; Sat, 03 Apr 2021 20:15:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id MNRqBNWwaGBPXQAAB5/wlQ (envelope-from ) for ; Sat, 03 Apr 2021 18:15:49 +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 51E111229D for ; Sat, 3 Apr 2021 20:15:48 +0200 (CEST) Received: from localhost ([::1]:44436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSkoE-0003hH-4W for larch@yhetil.org; Sat, 03 Apr 2021 14:15:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSknY-0003gz-2v for emacs-orgmode@gnu.org; Sat, 03 Apr 2021 14:15:04 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:57529) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSknW-0003YM-5s for emacs-orgmode@gnu.org; Sat, 03 Apr 2021 14:15:03 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 0C1E9109F90 for ; Sat, 3 Apr 2021 14:15:00 -0400 (EDT) (envelope-from wtd@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date:from:to :subject:message-id:mime-version:content-type; s=sasl; bh=fN4vKx ctlXpGUKznTs3x6dy32Ps=; b=gDRJ9JiENK0N1UAKzu5vHmHTF0FS18kBixV2CY Exxsv6MrNpdt3K26ZzJM0MAD04xmoiuuzSTV2R2uFQCBs9fXN5WZZ8kSFlXPYJL+ avQFWQIDv04Wwh98LQLeoORQ1kVvfR9KI5QXJBLHkidBBcCbewgQ3iJiI7v8QMx7 ey3iM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=date:from:to :subject:message-id:mime-version:content-type; q=dns; s=sasl; b= xpmhMlDzupoEdUfCXMM6AGjzoK4yMymKFUC5Gmv+6W6un3DcDtHKWtD7Zmv0xIyd bhYWvhZskINsiFJ6Kvf9qLCoj32x+D2ImyEHRwGFFiSIR7FxJ9iwKh0frYfYEJ2F gIV34kzKKOTrWQOAMhrNitQ+qlYqGoecaMmwD+F8/hI= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 05176109F8E for ; Sat, 3 Apr 2021 14:15:00 -0400 (EDT) (envelope-from wtd@pobox.com) Received: from shell3.miskatonic.org (unknown [199.103.62.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 91750109F8D for ; Sat, 3 Apr 2021 14:14:57 -0400 (EDT) (envelope-from wtd@pobox.com) Received: by shell3.miskatonic.org (Postfix, from userid 1000) id 138281227CD; Sat, 3 Apr 2021 14:14:56 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by shell3.miskatonic.org (Postfix) with ESMTP id 0EF4F1206B6 for ; Sat, 3 Apr 2021 14:14:56 -0400 (EDT) Date: Sat, 3 Apr 2021 14:14:56 -0400 (EDT) From: William Denton X-X-Sender: wtd@shell3.miskatonic.org To: emacs-orgmode@gnu.org Subject: How to get a table into a variable in a shell code block? Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Pobox-Relay-ID: 7F4D0766-94A8-11EB-AE03-D609E328BF65-56320186!pb-smtp21.pobox.com Received-SPF: pass client-ip=173.228.157.53; envelope-from=wtd@pobox.com; helo=pb-smtp21.pobox.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, 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=1617473748; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Yn4XaYA/+lYUKsInIjpY4Ob8aBwzZo5dMXs543mhgWY=; b=iU5OfZkK6uPwPmxyOsVsWyGowlZJK4/5J1L1199mGTmyM83XzM/AtVSeSM8XuDRQXYClc1 sVP1WUGQJfOJyU3Zkdf5uuMQSywfaJu9TskhjAMRRQ8SK+N3au6k47GyTugy1FS6AwrMQb gZ+3g08SXppdYteFTxpkk0fOl/2H9AmLEIKvht4/l3DFv/6PzmCmNv1LdPSR/o/Q+kopEE zKSSQ1ki7L56B8g3pgPtBtH/1DUPjS+LR/8Ko0VPbHyPTqbIJi6LV1aSJbzoeZlkvzUqnH +dk7B/vMOtUvREH5dgfy1D3ldbiUM6F90Aq9Qvr61gCYJ5ZDuO3YphPoV+fP2Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617473748; a=rsa-sha256; cv=none; b=NxD/hvwVszd4PoY9ljd+CY7XdPIc/eLLfyP4PdnjYo1ET0TB5exM1rPIpthI0nHPAQB23K NyspMiIoIvaEZ1la7Ilc2j6im+HGdjqh72EoamjIyYUWVjlhFWgWMHj9B1YgsuJGeZdy+G JU7N3GFcVhjZElgyfM75kB352qwyY9+eOPLqIzELyONRjUVJAbN18jVodlA+88KjuZqz5J yQHVdDTb7salzK/odIHWLlAQ+hjxycFKdPLl5PkpHvhEMJfukpE7myEiZUXpau0pAb28ZY JpkbRXS6eyJ13edEkS7W9KpAYnGb6A/nz40YiTXYSBL8WPABeCBT4P4I8jPsbQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=gDRJ9JiE; dmarc=pass (policy=none) header.from=pobox.com; 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: -2.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=gDRJ9JiE; dmarc=pass (policy=none) header.from=pobox.com; 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: 51E111229D X-Spam-Score: -2.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: a6rqHLok4Liv Let's say I have a table like this: #+NAME: numbers | one | | two | | three | I want to run through those numbers in a shell code block, but it I pass in table as a variable, it only sees the first number. #+begin_src shell :results output :var n=numbers echo $n #+end_src #+RESULTS: : one In Ruby it sees the numbers as an array: #+begin_src ruby :results output :var n=numbers puts n puts n.class #+end_src #+RESULTS: : one : two : three : Array And in R sees them as a data.table with one column. Both are very easy to iterate over, of course. I looked at the docs, but didn't see this covered, then I looked at ob-shell.el and saw the "org-babel--variable-assignments:bash_array" function, which might or might not be relevant, but it's all beyond my comprehension. Is there a way to get my shell code seeing all of the elements in the column? Thanks, Bill -- William Denton :: Toronto, Canada --- Listening to Art: https://listeningtoart.org/ https://www.miskatonic.org/ --- GHG.EARTH: https://ghg.earth/ Caveat lector. --- STAPLR: https://staplr.org/