[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shell aliases as shell-commands
From: |
Sebastian Tennant |
Subject: |
Re: Shell aliases as shell-commands |
Date: |
Wed, 21 Jan 2009 17:07:14 +0000 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) |
Quoth Peter Dyballa <Peter_Dyballa@Web.DE>:
> Am 21.01.2009 um 16:26 schrieb Sebastian Tennant:
>
>>> * In your emacs config (.emacs): (setenv "BASH_ENV" "~/.bashrc")
>>> This tells emacs that non-interactive bash subprocesses should
>>> load .bashrc.
>>
>> Damn that's a good tip. Guess I should tell the folks over at
>> emacs.sources...
>
> Not that fast, Sebastian! The solution with BASH_ENV will introduce
> problems with non-interactive bash shell scripts!
I'm not sure what you mean by non-interactive [...] scripts?
`BASH_ENV'
If this variable is set when Bash is invoked to execute a shell
script, its value is expanded and used as the name of a startup
file to read before executing the script.
If people set this variable, they can't complain if it then causes them
problems. After all, it's simply doing what it's designed to do!
> The solution I suggested is valid only inside GNU Emacs; this is the
> proper way.
Forgive me, but I thought I'd explained why your solution wasn't exactly
a solution.
The variable shell-command-switch can only hold a single switch and we
need to call bash with two switches; -i _and_ -c if we want
shell-command to have access to aliases (and functions). This is why I
went ahead and wrote interactive-shell-command (essentially a simpler
version of shell-command that calls shell-file-name (bash) with both
switches.
Sebastian
- Re: Shell aliases as shell-commands, (continued)
- Re: Shell aliases as shell-commands, Peter Dyballa, 2009/01/20
- Re: Shell aliases as shell-commands, Thierry Volpiatto, 2009/01/20
- Re: Shell aliases as shell-commands, Sebastian Tennant, 2009/01/20
- Message not available
- Re: Shell aliases as shell-commands, Teemu Likonen, 2009/01/20
- Re: Shell aliases as shell-commands, Sebastian Tennant, 2009/01/21
- Message not available
- Re: Shell aliases as shell-commands, Barry Margolin, 2009/01/21
- Re: Shell aliases as shell-commands, Sebastian Tennant, 2009/01/21
- Message not available
- Re: Shell aliases as shell-commands, Michael Heerdegen, 2009/01/21
- Re: Shell aliases as shell-commands, Sebastian Tennant, 2009/01/21
- Re: Shell aliases as shell-commands, Peter Dyballa, 2009/01/21
- Re: Shell aliases as shell-commands,
Sebastian Tennant <=
- Re: Shell aliases as shell-commands, Peter Dyballa, 2009/01/21
- Message not available
- Re: Shell aliases as shell-commands, Michael Heerdegen, 2009/01/22
- Re: Shell aliases as shell-commands, Peter Dyballa, 2009/01/22
- Re: Shell aliases as shell-commands, Sebastian Tennant, 2009/01/22
- Re: Shell aliases as shell-commands, Thierry Volpiatto, 2009/01/22
- Message not available
- Re: Shell aliases as shell-commands, Michael Heerdegen, 2009/01/22
- Re: Shell aliases as shell-commands, Sebastian Tennant, 2009/01/22
- Re: Shell aliases as shell-commands, Chetan, 2009/01/19