unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: executing bash function with shell-command
Date: Tue, 23 Feb 2016 01:34:33 +0100	[thread overview]
Message-ID: <87fuwkw9gm.fsf@debian.uxu> (raw)
In-Reply-To: 87k2lww9t2.fsf@debian.uxu

Emanuel Berg <embe8573@student.uu.se> writes:

> It is because when you open bash from Emacs bash is
> the interactive shell. When you open Emacs from bash
> Emacs talks to a non-interactive bash where BASH_ENV
> is the only thing that is sourced. (Or so I've heard
> - I don't use bash myself - I use zsh, where you
> solve this by putting shared stuff in .zshenv)
>
> So try putting the shared file path in BASH_ENV, or
> you can even try:
>
>     BASH_ENV=~/.bashrc emacs

Yes, this works for me even tho I'm on zsh.

In ~/.bashrc put this, carefully, as bash is fussy!

    function hi () {
        echo hello
    }

Then invoke Emacs like this:

    SHELL=/bin/bash BASH_ENV=~/.bashrc emacs -Q

Then:

    M-x shell-command RET hi RET

N.B. Don't rely on SHELL if you want to change the
shell in general. 

-- 
underground experts united
http://user.it.uu.se/~embe8573




  reply	other threads:[~2016-02-23  0:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22 19:58 executing bash function with shell-command mvar
2016-02-23  0:27 ` Emanuel Berg
2016-02-23  0:34   ` Emanuel Berg [this message]
     [not found] <mailman.14548.1456191752.841.help-gnu-emacs@gnu.org>
2016-02-24 21:52 ` mvar
2016-02-25  0:11   ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fuwkw9gm.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).