mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 107
L
LonDart Offline OP
Vogon poet
OP Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107

I wrote a script that filters extraneous lines out of my log files, and it works fine.

My logs are saved as mircdir\logs\network\#channel.date.log

I filter from the log file to a text file, which is then renamed to mircdir\logs\network\#channel.date.txt

I thought I'd prefer to have it renamed as mircdir\logs\network\#channel.date.log.txt
but I can't get it to work.

This:

Code:
//echo -s $+(%chlog,.txt)


returns mircdir\logs\network\#channel.date.log.txt

But this:

Code:
/rename filtchlog.txt $+(%chlog,.txt)


still returns mircdir\logs\network\#channel.date.txt

While being able to do this is truly unimportant, I would love to know if I am missing something,
or if this is a bug, or what.



LonDart
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You have to double evaluate.
Use /rename filthlog.txt $($+(%,chlog,.txt),2)

This is one of those things that you don't find out about until you try. Personally I don't think it's a bug, but then again I can see your point.

Joined: Jul 2006
Posts: 107
L
LonDart Offline OP
Vogon poet
OP Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
Thanks RusselB.

I guess I never thought of evaluation, because the offline echo worked without it.

I played with quoting and unquoting, but not the double evaluation. That's part of the fun of
scripting, I guess; having to think of everything. smile


LonDart
Joined: Jul 2006
Posts: 107
L
LonDart Offline OP
Vogon poet
OP Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
Well, it turns out that the problem was the quoting and unquoting.

The script sets the %chlog variable to the full path to the log, with quotes, then calls
a text file that plays to the filter command and renames the temporary file.

The reason my playing around with the quoting and unquoting wouldn't work was dopey me
never changed the path to the text file in the script, so it never saw the new commands. blush

Details, details.


LonDart

Link Copied to Clipboard