From: ken <gebser@mousecar.com>
To: help-gnu-emacs@gnu.org
Subject: Re: how to use bash alias in emacs compile
Date: Mon, 07 May 2012 16:04:01 -0400 [thread overview]
Message-ID: <4FA82AB1.6030702@mousecar.com> (raw)
In-Reply-To: <9478bdbc-94cd-4b58-bea3-ed63453a39c5@kw17g2000pbb.googlegroups.com>
On 05/07/2012 03:48 PM Daniel (Youngwhan) wrote:
> On May 3, 1:35 am, "Pascal J. Bourguignon"<p...@informatimago.com>
> wrote:
>> "Daniel (Youngwhan)"<breadn...@gmail.com> writes:
>>> Hi,
>>
>>> I have alias like this:
>>
>>> alias dm='cd ~/XYZ&& ./mycompile.sh'
>>
>> Where do you have it?
>>
>
> The lots of aliases are defined in a file, where is in $HOME/bin, and
> the $PATH has it, too.
>
>>> I typed M-x compile, and tried to run by just typing "dm", but it
>>> doesn't recognize.
>>
>> Try: M-x compile RET C-a C-k bash -i -c dm RET
>>
>
> Yeah, it works!, but if I typed only dm, it doesn't.
>
>>> I searched and some suggest BASH_ENV, so I tried, but not working.
>>
>> man bash explains in details what file it will load and when, but it's
>> complicated. I put everything in ~/.bashrc
>>
>
> Let me study you've mentioned here, but if you can share your
> experience in detail, it would be appreciated.
Yes, ~/.bashrc is the place to put aliases... because then they are
loaded whenever you log in. If this isn't the behavior you want, then
you can put them somewhere else, e.g., in ~/bin/aliases, but then you'll
have to invoke them yourself. This can be done with either of these
commands:
source ~/bin/aliases
or
. ~/bin/aliases
(Note that "~/bin/aliases" is an example name I made up. Just about any
normal filename can be given.)
If you edit ~/.bashrc, including new aliases in it, you can use the same
commands as above to read those new aliases into the current environment
with:
source ~/.bashrc
or
. ~/.bashrc
Then you don't have to log out and then log back in to put your new
aliases into effect.
hth
next prev parent reply other threads:[~2012-05-07 20:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-02 21:28 how to use bash alias in emacs compile Daniel (Youngwhan)
2012-05-02 21:42 ` Peter Dyballa
2012-05-02 22:55 ` Barry Margolin
2012-05-03 8:35 ` Pascal J. Bourguignon
2012-05-07 19:48 ` Daniel (Youngwhan)
2012-05-07 20:04 ` ken [this message]
2012-05-07 20:18 ` Pascal J. Bourguignon
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FA82AB1.6030702@mousecar.com \
--to=gebser@mousecar.com \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.