Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Aliases ... appending unused parameters?

May
12,998
174
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

Back
Top