mIRC Home    About    Download    Register    News    Help

Print Thread
#94724 19/08/04 05:02 AM
Joined: Dec 2002
Posts: 208
H
Hrung Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Dec 2002
Posts: 208
alias test {
echo -a a $&
b | echo -a c }
}

the above code will echo one line that says

a b | echo -a c

instead of the expected

a b
c


If I knew now what I will know then... maybe things will have been different...
#94725 19/08/04 04:49 PM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
Code:
alias test {
  echo -a a $& b | echo -a c 
}

 

returns:
a b
c

Windows 2000 Pro .. mIRC 6.16

(by the way, you had an extra } in what you pasted)


I refuse to engage in a battle of wits with an unarmed person. wink
#94726 19/08/04 06:01 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Confirmed here. XP home SP1 and mIRC v6.16


"All we are saying is give peace a chance" -- John Lennon
#94727 19/08/04 08:45 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788

alias test {
echo -a a $& b | echo -a c
}


Confirmed the 'bug' here, yes you did have an extra bracket, minor typo i would guess, however CtrlAltDel, the reason the above gives you what it does is because $& is suppose to link commands that are on different lines, not the same one.

echo -a a $&
b | echo -a c


Eamonn.

#94728 20/08/04 01:44 AM
Joined: Dec 2002
Posts: 208
H
Hrung Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Dec 2002
Posts: 208
the extra } was kind of a typo.. the original code had it in an if, and in attempting to find the simplest script that would duplicate the error, i forgot to remove that extra }. does the same thing either way.


If I knew now what I will know then... maybe things will have been different...

Link Copied to Clipboard