x
ETF2L is looking for new Staff to recruit! Are you interested in supporting the league? Then click here for more details on what we can offer and how to apply! 
x
To those who participated in the Highlander Season 32 (Summer 2024), please fill out this Feedback Form for the current & next Highlander seasons!

Forum

How to echo a semicolon in an alias?

Created 15th November 2011 @ 12:35

Add A Reply Pages: 1

Spike Himself

TC

What the title says ^

I want an alias to print a connect string to console for copy/pasting cuz lazy, but semicolons are interpreted to terminate the line/cmd. Can it be escaped or something?

Something along the lines of
alias "con1" "echo connect s1.colonslash.eu:28001; password lolright"


Last edited by Spike Himself,

jonii

fm-eSportstf2

bind it directly? like

bind “F1” “connect s1.colonslash.eu:28001; password lolright”

works for me, and saves the trouble of copy pasting it

Spike Himself

TC

Quoted from jonii

bind it directly? like

bind “F1” “connect s1.colonslash.eu:28001; password lolright”

works for me, and saves the trouble of copy pasting it

Yeah, I have the bind already – that’s not the issue.

I don’t want to paste it in console myself – I want to paste it on mumble/steam to team mates :)

Apparently:

<+freshmeatt> Can’t be escaped in an alias,
<+freshmeatt> Although if you put the say/echo command in another cfg file and just exec it, it’ll parse it right.
<+freshmeatt> Try putting in console say aaa;bbb – it will actually parse that right.

Will have to try that out when I get home ))


Last edited by Spike Himself,

jonii

fm-eSportstf2

if you have a bind to connect to it, you can also do “bind key” and it’ll echo the connect too, like bind f1 will echo the command that you have for f1

if you want to do it for servers you don’t have a bind to connect to dunno :<

slate

(ETF2L Donator)
AMG

only way i know is as freshmeat said.

set up one .cfg per server containing

echo “connect server1:27015;password test”

and then exec those files.

octochris

(0v0)

It’s not possible to do it with an alias due to the way that arguments to an alias are handled (and for some reason there is no escape, thanks Valve).

As you can see, echo handles quotes as requesting literal interpretation.

] echo “connect foo; password bar”
connect foo; password bar
] echo connect foo; password bar
connect foo

Clearly the quoting does make a difference in this case, but what about in other cases?

] alias foo echo “connect foo; password bar”
] foo
connect foo
] alias
Current alias commands:
foo : echo connect foo; password bar

As you can see, the effects of quoting seem to be specific to the command being run. My best guess (with no source available) is that the quotes are passed literally to the command, which then decides what to do with them, and this behaviour is not standardised.

There also appears to be a complete lack of an escape character in TF2, which is kind of annoying.

The best option is probably something like putting echo "connect foo; password bar" in a config file, and then aliasing an exec of it.

broesel

LAME

Quoted from octochris

There also appears to be a complete lack of an escape character in TF2

\ go go :D


Last edited by broesel,

Add A Reply Pages: 1