emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to get shell source blocks to read my profile?
@ 2021-03-14 21:30 George Mauer
  2021-03-14 21:51 ` Tim Cross
  0 siblings, 1 reply; 12+ messages in thread
From: George Mauer @ 2021-03-14 21:30 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]

I am confused why no matter how I try to run shell commands they seem to be
missing variables exported in profiles.

I have added 3 variables to various startup scripts

  - ~./bash-profile~ :: ~export GIM_BASH_PROFILE="yes"~
  - ~./bashrc~ :: ~export GIM_BASHRC="yes"~
  - ~./zshrc~ :: ~export GIM_ZSHRC="yes"~

I am running emacs in GUI mode so I get why none of these are available
*directly* in emacs, so then I try

  #+begin_src shell :results list
    env | grep GIM
  #+end_src

  #+RESULTS:

Ok that's kinda surprising, but I suppose it could be running ~/bin/zsh~
(that's my ~shell-file-name~) directly

what about

  #+begin_src shell :results list
    bash -c env | grep GIM
  #+end_src

  #+RESULTS:

That's pretty surprising. I would have expected running it directly to
actually run my profile.

Shockingly

  #+begin_src shell :results list
    bash --rcfile ~/.bashrc -c env | grep GIM
  #+end_src

  #+RESULTS:

That is *still* nothing!

Sanity is restored slightly when I run

  #+begin_src shell :results list
    bash --login -c env | grep GIM
  #+end_src

which *does* indeed visit ~.bash_profile~ but only slightly.

What is going on, and is there a straightforward way in which I can get
shell block to read from a profile?

[-- Attachment #2: Type: text/html, Size: 1621 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-03-18 15:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 21:30 How to get shell source blocks to read my profile? George Mauer
2021-03-14 21:51 ` Tim Cross
2021-03-15  2:35   ` George Mauer
2021-03-15  3:02     ` Tim Cross
2021-03-15 17:49       ` George Mauer
2021-03-15 19:53         ` Tim Cross
2021-03-16  0:52           ` Steven Harris
2021-03-16 12:20         ` Maxim Nikulin
2021-03-16 13:21           ` George Mauer
2021-03-16 16:49             ` Nick Dokos
2021-03-16 20:32             ` Tim Cross
2021-03-18 14:59             ` Maxim Nikulin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).