help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: export EDITOR="emacsclient -c -a emacs" doesn’t work


From: Eli Schwartz
Subject: Re: export EDITOR="emacsclient -c -a emacs" doesn’t work
Date: Mon, 1 Feb 2021 07:19:24 -0500

On 2/1/21 12:06 AM, Pankaj Jangid wrote:
> I have ‘emacsclient’ and ‘emacs’ in PATH. I prepend the location of
> these two binaries to the PATH environment variable before exporting
> EDITOR environment variable. Like this in my ~/.bash_profile.
> 
> export 
> PATH=~/Applications/Emacs.app/Contents/MacOS:~/Applications/Emacs.app/Contents/MacOS/bin:$PATH
> export EDITOR="emacsclient -c -a emacs"
> 
> Both the commands are working fine in my shell. i.e. I can run ‘emacs’
> as well as ‘emacsclient -c -a emacs’ from shell.
> 
> But whenever I run any other utility, which is dependent on $EDITOR, I
> get this error,
> 
> --8<---------------cut here---------------start------------->8---
> $ crontab -e
> crontab: emacsclient -c -a emacs: No such file or directory
> crontab: "emacsclient -c -a emacs" exited with status 1
> --8<---------------cut here---------------end--------------->8---
> 
> What am I missing here?


The non-bash programs you are using, have correctly been forked with the
environment variable EDITOR defined to a string that contains spaces.

Those programs then made the choice to treat EDITOR as a string
referring to a binary name. Which, naturally, does not exist.

Why don't they treat it as a string to be processed, split on
whitespace, and treated as a binary name followed by an array of binary
arguments? I don't know, you could try asking your `crontab` vendor
about that choice. It's certainly not a choice imposed by bash, for good
or ill.


-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]