From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [babel] passing strings in Date: Thu, 25 Mar 2010 12:09:45 -0400 Message-ID: <87pr2sxu0m.fsf@stats.ox.ac.uk> References: <87eij8whoa.fsf@cuma.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NupdQ-0004lb-3C for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 12:10:16 -0400 Received: from [140.186.70.92] (port=37073 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NupdF-0003ro-Fp for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 12:10:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nupd9-0006Sg-Hk for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 12:10:01 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:37483) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nupd8-0006SK-VG for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 12:09:59 -0400 In-Reply-To: <87eij8whoa.fsf@cuma.i-did-not-set--mail-host-address--so-tickle-me> (Maurizio Vitale's message of "Thu, 25 Mar 2010 11:21:41 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: maurizio.vitale@polymath-solutions.com Cc: emacs-orgmode@gnu.org Maurizio Vitale writes: > In the table/block pair below, I'm trying to pass an IP number to some > shell code. Hi Maurizio, I think you've forgotten to specify that 'ip' is an argument of the system-ping block. So either add e.g. :var ip=0 or use #+source: system-ping(ip=0) (You can of course use any default argument value other than 0) Additionally, I'm finding that the ip column needs to be single-quoted (whether it is an IP number or a human-readable alias). I'm rushing a bit at the moment, but that looks like a bug. So in any case, this works for me (also works with single-quoted IP numbers) | name | ip | ping | |--------+----------------+------| | host 1 | 'orgmode.org' | 0 | | host 2 | 'xorgmode.org' | 2 | #+TBLFM: $3='(sbe system-ping (ip $2)) #+source: system-ping(ip=0) #+begin_src sh ping -w 10 -c 1 -q $ip >/dev/null 2>&1 echo $? #+end_src Dan > It seems like in the table formula I can only have > numbers. Is that right? > > #+TBLNAME: system-host-ping :var host=system-hosts > | name | ip | ping | > |-----------+----------------+--------| > | host 1 | 192.168.10.200 | #ERROR | > | host 2 | 192.168.10.24 | #ERROR | > | host 3 | 192.168.42.24 | #ERROR | > #+TBLFM: $3='(sbe system-ping (ip $2))' > > #+source: system-ping > #+begin_src sh > # This is what I eventually want > #ping -w 10 -c 1 -q $ip >/dev/null 2>&1 > #echo $? > > # Testing > echo $ip > #+end_src > > Any way to pass arbitrary strings? > > Thanks a lot, > > Maurizio > > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode