From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: [Babel] No output returned if just one command is failing Date: Thu, 02 Dec 2010 11:03:03 +0100 Message-ID: <80lj488pbc.fsf@missioncriticalit.com> References: <80eia1ondv.fsf@missioncriticalit.com> <87r5e1ftxl.fsf@gmail.com> <80sjyhjz0b.fsf@missioncriticalit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Eric, S=C3=A9bastien Vauban wrote: > "Eric Schulte" wrote: >> I don't forsee adding partial results insertion both because >> >> - it would add a good deal of complexity to the code to insert results >> part-way through a run > > I can't comment on this, of course. > >> - the current behavior of only inserting results on a fully successful r= un >> is reasonable and is probably more obvious (at least to me) than >> inserting partial results > > Being fond of Babel, I'm using it always, everywhere. I prefer: > > 1. typing my shell commands in an Org buffer, > 2. evaluate the block, > 3. get the results automagically inserted in the buffer, > 4. (eventually, version the whole file for later comparisons when updating > the code), > 5. export the whole to HTML and/or PDF. > > The current behavior, even if totally respectable and defendable, inhibits > such a way of working: if you write (or update) a shell code, and don't s= ee > (more or less) the same things as the ones you would see in a shell buffe= r, > then you can't use such an Org buffer -- as long as one command fails. > > I don't especially want you to change your position, but I'm explaining t= he > "negative" consequences for me. BTW, what's the internal "definition" (in Org Babel) of "unsuccessful run" = of a (sh) command block? Is it "return code !=3D 0"? If yes, such a sh block would never produce any results when the machine is not a known name (as first command would "fail"): #+begin_src sh :var machine :results output ping $machine rc=3D$? if [ $rc =3D=3D 0 ]; then echo "Machine pinged successfully with its name..."; else echo "Trying to ping machine by its IP..."; ipmachine=3D$(grep whichever-list.txt | cut -f 2); ping $ipmachine fi #+end_src (the above is just a simply sample of code which includes tests of rc) Though, it does currently work with both known and unknown machines. So I'm clearly missing something here. Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode