Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

the alias remembers that it used to end with a space

0 views
Skip to first unread message

Ilya Beylin

unread,
Dec 20, 2001, 5:54:53 AM12/20/01
to
Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.5.1
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' -DCONF_OSTYPE='solaris2.5.1' -DCONF_MACHTYPE='sparc-sun-solaris2.5.1' -DCONF_VENDOR='sun' -DSHELL -DHAVE_CONFIG_H -DSunOS5 -I. -I. -I./include -I./lib -I/usr/local/include -g -O2
uname output: SunOS rhea 5.5.1 Generic_103640-27 sun4u sparc SUNW,Ultra-4
Machine Type: sparc-sun-solaris2.5.1

Bash Version: 2.04
Patch Level: 0
Release Status: release

Description:
According to the documentation,
http://www.gnu.org/manual/bash/html_chapter/bashref_5.html#IDX204

If the last character of the alias value is a space or tab character,
then the next command word following the alias is also checked for
alias expansion.

It appears that this property is sticky, that is, if the alias first
is assigned a value that ends on a space, and then another value,
without a space, the secondary expansion continues as before.

The expansion of an alias depends thus on its history, not only on its
current value.

Repeat-By: bash --norc
bash-2.04$ alias foo='echo'
bash-2.04$ foo foo
foo
bash-2.04$ alias foo='echo '
bash-2.04$ alias foo='echo'
bash-2.04$ foo foo
echo
bash-2.04$

0 new messages