[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: kill-emacs and returning values
From: |
Mathias Megyei |
Subject: |
Re: kill-emacs and returning values |
Date: |
Sat, 14 Feb 2009 22:47:51 +0100 |
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