cquilliam Voice
Joined: 05 Nov 2009 Posts: 2
|
Posted: Thu Nov 05, 2009 10:56 am Post subject: Adding multiple commands to Exec |
|
|
I am trying to create a url catcher for my eggdrop that not only stores the url, but also grabs the title of the page. Now, I have been able to achieve this goal by having tcl call an external bash script of the follow:
the tcl part:
| Code: |
set fd [open $urllogfile a+]
set title [exec gettitle.sh $i]
puts $fd "$i;[ctime [unixtime]];$title;$nick;$chan"
close $fd
|
the bash part:
| Code: |
#!/bin/sh
TITLE=`lynx -source $1 | grep -i "<title>" | awk -F "<title>" '{print $2}' | awk -F "</title>" '{print $1}'`
if [ "$TITLE" = "" ]; then
echo No Title Found
else
echo $TITLE
fi
|
Now, while this is working, it is messy to call an external script like this, so, I was wondering if it was possible to translate this into TCL so its all in the same script?
Thanks in advance for any help or tips. |
|