Aliases ... appending unused parameters?

May 20, 2008
12,331
134
Syracuse, NY, USA
Shouldn't aliases append a space before appending unused parameters?
Code:
v:\> alias test
grep %1 u:\lib\words

v:\> test a/b
grep: error: Cannot read file u:\lib\words/b

v:\> test a,b
grep: error: Cannot read file u:\lib\wordsb
 
It should, if you provide a space in the command. If you alias 'grep' to echo, and run the same tests again

Code:
alias test
grep %1 ues.txt

alias grep
echo

test a/b gives "a ues.txt/b"
test a,b gives "a ues.txtb"
test a^/b  gives "a/b ues.txt"
test a^,b  gives "a,b ues.txt"
test a b  gives "a ues.txt b"

Escaping the / or comma gives the desired results, ie "a/b ues.txt" and "a,b ues.txt" makes a/b and a,b into %1

Putting a space between the params gives "a ues.txt b" which is %1 aliasargs %2

Strange behaviour, but present in 4nt 8.01.70 on NT 5.00.2195 too.[/code]
 

Similar threads