bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bash expansion nuance or bug?


From: Linda Walsh
Subject: Bash expansion nuance or bug?
Date: Wed, 21 Jun 2006 20:12:09 -0700
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

I ran into an oddity in alias expansion.  I don't know if it
is a bug, or some feature I'm unfamiliar with:

Two aliases:
   alias ls='ls -CFG --show-control-chars --color=tty '
   alias dir='ls'

If I type "ls dir" (created a test dir called dir), I
get:
   "ls dir"
I get:
   ls: ls: No such file or directory.

This was "unexpected". Tracing showed:

/tmp> ls foo
+ ls -CFG --show-control-chars --color=tty foo
ls: foo: No such file or directory
---the above is "normal"---but below:
/tmp> ls dir
+ ls -CFG --show-control-chars --color=tty ls -CFG --show-control-chars --color=tty
ls: ls: No such file or directory
----  Where the filename should have been I see dir treated
as another alias to be expanded. Huh?
I traced the cause to the ls alias -- the "space" at the
end of the alias is causing the behavior: with space,
it expands "dir" as another alias.  Without the space at
the end, it works as I would have normally expected.

Is this a bug, or some feature I'm unfamiliar with?

Thanks,
-linda






reply via email to

[Prev in Thread] Current Thread [Next in Thread]