Version: GNU bash, version 3.00.16(1)-release (i386-pc-linux-gnu)
Hardware: AMD Athlon 3GHz+, 1G RAM.
OS: Linux (Knoppix-3.9).
Compilation: Distributed by Debian.
Description: An alias defined within an "if" branch has no effect.
Recipe: in the following script, the alias "mycp" is unknown command.
The problem disappears when
the line "alias myls=ls" is moved before the "if" line.
Note that the definition is however recorgnized by "alias -p".
The same phenomenon is reported on slightly different recent builds of
Linux.
####################################
#! /bin/bash
if true; then
alias myls=ls
alias -p
myls
fi
myls
####################################
--
XIAO Gang (~{P$8U~}) http://wims.unice.fr/xiao/
_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash