| View previous topic :: View next topic |
| Author |
Message |
BCyo+8C4 Voice
Joined: 03 Sep 2006 Posts: 24
|
Posted: Mon Jul 21, 2008 2:24 pm Post subject: exec awk problem with quotes |
|
|
Hi,
I need a tcl to start awk like this:
| Code: | | awk -f alfa.awk -v was="array('$mask'" bans-$chan.txt >bans-$chan-tmp.txt |
But when I put it in my script (after exec) like that it complains about "extra characters after close-quote"
If I escape them (\") I get: Invalid command name """
I also tried this but that failed as well:
| Code: | set varname "awk -f alfa.awk -v was=\"array('$mask'\" bans-$chan.txt >bans-$chan-tmp.txt"
eval exec $varname |
What's the correct way to escape those quotation chars? |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon Jul 21, 2008 2:32 pm Post subject: |
|
|
| Code: | set awk [list awk -f alfa.awk -v was="array('$mask'" bans-$chan.txt >bans-$chan-tmp.txt]
eval exec $awk |
Encapsulate your arguments within [list] evaluation. See if that helps. | Quote: | <speechles> .tcl set a [list awk -f alfa.awk -v was="array('mask'" bans-chan.txt >bans-chan-tmp.txt]
<bot> Tcl: awk -f alfa.awk -v was=\"array('mask'\" bans-chan.txt >bans-chan-tmp.txt
* I had to strip the $ from your variables as I don't have those set *
* It would've worked with them if I had those set... * |
_________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
BCyo+8C4 Voice
Joined: 03 Sep 2006 Posts: 24
|
Posted: Mon Jul 21, 2008 3:11 pm Post subject: |
|
|
that doesn't work either.
while there's no error in console now the file is simply not changed, it's like awk didn't run at all.
example "bans-chan.txt":
example tcl:
| Code: | set awk [list awk -f alfa.awk -v was=");" bans-chan.txt >bans-chan-tmp.txt]
eval exec $awk |
the awk command itself is correct as it works in shell
EDIT: Well, never mind I guess, I found another solution (without using awk) |
|
| Back to top |
|
 |
|