unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Peter Dyballa <Peter_Dyballa@Web.DE>
To: Matthew Flaschen <matthew.flaschen@gatech.edu>
Cc: emacs <help-gnu-emacs@gnu.org>
Subject: Re: "source" shell commands
Date: Sun, 25 Mar 2007 13:53:27 +0200	[thread overview]
Message-ID: <6A88E31C-15DF-4589-9D89-F5C572080230@Web.DE> (raw)
In-Reply-To: <46065528.5000702@gatech.edu>


Am 25.03.2007 um 12:55 schrieb Matthew Flaschen:

> Apparently bash.  However, ~/.bashrc already sources ~/.rc , which
> includes JAVA_HOME .  It was my impression that bash *always* read
> ~/.bashrc .

As I recommended: put an

	echo " Hi, Matt! It's me, your ~/.bashrc. Remember me, still?" > / 
dev/console

into your ~/.bashrc and see what you'll see.


What is pstree showing? For me, on Mac OS X, and launched from some  
menu, I get:

	pete 123 /\ pstree -p $$
	-+= 00001 root /sbin/launchd -v
	\-+- 01695 pete -bin/tcsh -i -c /usr/local/bin/emacs-23.0.0 - 
geometry  100x57+666+44
	   \-+- 01700 pete /usr/local/bin/emacs-23.0.0 -geometry 100x57+666+44
	     \-+= 01701 pete -bin/tcsh -i
	       \-+= 04001 pete pstree -p 1701
	         \--- 04002 root ps -axwwo user

An interactive tcsh stands at my beginning.


'Man bash,' in GNU Emacs, will reveal:

	• when invoked as a login shell, it will read /etc/profile,  
~/.bash_profile, ~/.bash_login, ~/.profile in that sequence;

	• when invoked as an interactive shell, that is no login shell, it  
will read ~/.bashrc;

	• when invoked with the name sh, it mimics the Bourne shell reading / 
etc/profile and ~/.profile, in that order;

	• when a login shell is finished, ~/.bash_logout is read.

There are constraints with environment variables like ENV or  
BASH_ENV. So even a non-interactive non-login bash can read (and  
execute) some RC files.

When the login bash hits the first of the many personal RC files, it  
only executes the first one. So, IMO, it's best to put everything  
personal in Bourne shell syntax into ~/.profile, which a Bourne shell  
or Bourne shell bash will read (and execute) also.

And read, not entirely, you have C-s, the *Man bash* buffer a few times!


> Should I source ~/.rc in ~/.profile instead?

No. Keep it simple, let bash do its job right.

--
Greetings

   Pete

Math illiteracy affects 7 out of every 5 Americans.

  reply	other threads:[~2007-03-25 11:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1360.1174733204.7795.help-gnu-emacs@gnu.org>
2007-03-24 13:33 ` "source" shell commands Tassilo Horn
2007-03-24 14:35   ` David Kastrup
2007-03-24 15:24     ` Barry Margolin
2007-03-24 21:21       ` Matthew Flaschen
2007-03-25  0:08         ` Matthew Flaschen
2007-03-25 10:33           ` Peter Dyballa
2007-03-25 10:55             ` Matthew Flaschen
2007-03-25 11:53               ` Peter Dyballa [this message]
2007-03-26  0:44                 ` Matthew Flaschen
2007-03-26  8:16                   ` Peter Dyballa
2007-03-26  9:59                     ` Matthew Flaschen
     [not found]               ` <mailman.1412.1174823876.7795.help-gnu-emacs@gnu.org>
2007-03-25 22:36                 ` Tim X
2007-03-26  0:53                   ` Matthew Flaschen
     [not found]                   ` <mailman.1432.1174870550.7795.help-gnu-emacs@gnu.org>
2007-03-26 11:30                     ` Tim X
     [not found]       ` <mailman.1381.1174771402.7795.help-gnu-emacs@gnu.org>
2007-03-25  2:46         ` Tim X
2007-03-25  4:03           ` Matthew Flaschen
     [not found]           ` <mailman.1397.1174795525.7795.help-gnu-emacs@gnu.org>
2007-03-25 10:56             ` Tim X
2007-03-26  8:13             ` Tassilo Horn
2007-03-26  8:57               ` Matthew Flaschen
     [not found]               ` <mailman.1436.1174899596.7795.help-gnu-emacs@gnu.org>
2007-03-26  9:08                 ` Tassilo Horn
2007-03-26  9:55                   ` Matthew Flaschen
2007-03-25  2:32 ` Tim X
2007-03-25  2:59   ` Matthew Flaschen
2007-03-24 10:44 Matthew Flaschen

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=6A88E31C-15DF-4589-9D89-F5C572080230@Web.DE \
    --to=peter_dyballa@web.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=matthew.flaschen@gatech.edu \
    /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).