From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] passing strings in Date: Thu, 25 Mar 2010 10:00:40 -0600 Message-ID: <87ljdgjsr2.fsf@gmail.com> 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 1NupUT-0001GE-Sq for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 12:01:02 -0400 Received: from [140.186.70.92] (port=46276 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NupUR-0001Ez-HX for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 12:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NupUM-00056T-8c for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 12:00:59 -0400 Received: from mail-pz0-f197.google.com ([209.85.222.197]:59971) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NupUM-00056J-3B for emacs-orgmode@gnu.org; Thu, 25 Mar 2010 12:00:54 -0400 Received: by pzk35 with SMTP id 35so181249pzk.24 for ; Thu, 25 Mar 2010 09:00:52 -0700 (PDT) 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 Hi Maurizio, The ip addresses in your table are being interpreted as source/reference names which org-babel is trying to resolve. In order to differentiate between strings and reference names, we either must surround all strings in double quotes (as below) or we must end all references with "()" and disallow any strings which end in "()". Currently we are taking the former approach, which means your table will require the following to work... #+TBLNAME: system-host-ping :var host=system-hosts | name | ip | ping | |--------+------------------+----------------| | host 1 | "192.168.10.200" | 192.168.10.200 | | host 2 | "192.168.10.24" | 192.168.10.24 | | host 3 | "192.168.42.24" | 192.168.42.24 | #+TBLFM: $3='(sbe system-ping (ip $2))' #+source: system-ping #+begin_src sh :var ip=0 # This is what I eventually want #ping -w 10 -c 1 -q $ip >/dev/null 2>&1 #echo $? # Testing echo $ip #+end_src I'd be open to discussion on this issue. I suppose if reference resolution fails we could try using the name as a string literal, but that could lead to debugging nightmares... Cheers -- Eric Maurizio Vitale writes: > In the table/block pair below, I'm trying to pass an IP number to some > shell code. 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