Aliases fail in command substitution in noninteractive mode.

2006-06-04 Thread fsateler
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2
uname output: Linux genoa1 2.6.16-1-k7 #2 Thu May 4 18:35:10 UTC 2006 i686 
GNU/Linux
Machine Type: i486-pc-linux-gnu

Bash Version: 3.1
Patch Level: 14
Release Status: release

Description:
Aliases don't work correctly in command substitution when in 
noninteractive mode. They do work when in interactive mode.
Repeat-By:
The following script illustrates the problem:

#!/bin/bash
alias foo=echo
echo `foo hi`
echo $(foo hi)

When I call it, I get a "foo: command not found" error. However, if I
insert those commands manually in my shell, they work as expected.


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: Aliases fail in command substitution in noninteractive mode.

2006-06-04 Thread Paul Jarc
[EMAIL PROTECTED] wrote:
>   Aliases don't work correctly in command substitution when in 
>   noninteractive mode. They do work when in interactive mode.

man bash, under "ALIASES":
   Aliases are not expanded when the shell is not interactive, unless  the
   expand_aliases  shell option is set using shopt (see the description of
   shopt under SHELL BUILTIN COMMANDS below).


paul


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash