From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Megyei Newsgroups: gmane.emacs.devel Subject: Re: kill-emacs and returning values Date: Sat, 14 Feb 2009 22:47:51 +0100 Message-ID: <1234648071.6514.43.camel@surlej> References: <7dbe73ed0902140551w7a85d043n54e451896d99279e@mail.gmail.com> <1234631845.6514.4.camel@surlej> <7dbe73ed0902141223w1d2e16d6kc8287caa26c40019@mail.gmail.com> Reply-To: mathias@mnet-mail.de NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1234648088 17517 80.91.229.12 (14 Feb 2009 21:48:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Feb 2009 21:48:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: Mathias Dahl Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 14 22:49:23 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LYSO3-0004uk-58 for ged-emacs-devel@m.gmane.org; Sat, 14 Feb 2009 22:49:23 +0100 Original-Received: from localhost ([127.0.0.1]:47359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LYSMj-0005MC-4X for ged-emacs-devel@m.gmane.org; Sat, 14 Feb 2009 16:48:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LYSMf-0005Lx-63 for emacs-devel@gnu.org; Sat, 14 Feb 2009 16:47:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LYSMd-0005Ll-6Q for emacs-devel@gnu.org; Sat, 14 Feb 2009 16:47:56 -0500 Original-Received: from [199.232.76.173] (port=35256 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LYSMd-0005Li-1i for emacs-devel@gnu.org; Sat, 14 Feb 2009 16:47:55 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.10]:51040) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LYSMc-0000ht-LU for emacs-devel@gnu.org; Sat, 14 Feb 2009 16:47:54 -0500 Original-Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 548281C01EC9; Sat, 14 Feb 2009 22:47:53 +0100 (CET) Original-Received: from localhost (dynscan2.mnet-online.de [192.168.1.215]) by mail.m-online.net (Postfix) with ESMTP id 4C82790193; Sat, 14 Feb 2009 22:47:53 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.3.149]) by localhost (dynscan2.mnet-online.de [192.168.1.215]) (amavisd-new, port 10024) with ESMTP id YLCU3yNrBndj; Sat, 14 Feb 2009 22:47:51 +0100 (CET) Original-Received: from [192.168.178.21] (ppp-93-104-39-1.dynamic.mnet-online.de [93.104.39.1]) by mail.mnet-online.de (Postfix) with ESMTP; Sat, 14 Feb 2009 22:47:51 +0100 (CET) In-Reply-To: <7dbe73ed0902141223w1d2e16d6kc8287caa26c40019@mail.gmail.com> X-Mailer: Evolution 2.24.3 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109077 Archived-At: On Sat, 2009-02-14 at 21:23 +0100, Mathias Dahl wrote: > > Does it work for your purpose if you change the last line > > to: > > > > (kill-emacs "returnvalue='This is the return value.'") > > > > > > $ emacs -Q -nw -l ke.el > > > > returnvalue='This is the return value.' > > > > $ echo $returnvalue > > I tried that already and it would have - if it worked :( Could this > depend on which shell you use? I am using bash. > Yes, it depends on the shell in question. The above is for Bash. It works when Emacs is invoked "by hand" but not if it was started in a shell script. It seems the command returnvalue='This is the return value.' is executed after the script has finished (as the next "keyboard input"). Within the script you can read in the "next keyboard input" into a variable. The following script seems to do what you want: #!/bin/bash /opt/emacs/23.0.60/bin/emacs -Q -nw -l ke.el read myval echo "myval is set to: '$myval'" Mathias