This question already has an answer here:
- Export EDITOR with a flag 1 answer
I have set up
$ echo $EDITOR
emacs -nw
I was wondering why it is not found here, and how I can solve the problem? Thanks.
$ sdiff -o sdiff.out f1 f2
1 2 3 | 2 3 4
%e1
sdiff: subsidiary program 'emacs -nw' not found
I don't know why an option in $EDITOR
is a problem, and where it is required in sdiff
source code? I guess it is here http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n459
prog = getenv ("EDITOR");
if (prog)
editor_program = prog;
and here http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1035
execvp (editor_program, (char **) argv);
or http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1018 and http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1024. I am not sure what the program is doing.
For comparison, the following works perfectly fine:
$ eval "$EDITOR"