egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

wget tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
pinkel
Voice


Joined: 21 May 2008
Posts: 8

PostPosted: Sat May 31, 2008 5:30 am    Post subject: wget tcl Reply with quote

Is it possible to use wget in .tcl?
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat May 31, 2008 6:51 am    Post subject: Reply with quote

You can execute shell commands using the [exec] Tcl command.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat May 31, 2008 7:03 am    Post subject: Reply with quote

Be advised that exec will block code execution while the command is executed, so downloading large files or accessing slow servers this way may cause your bot to become unresponsive for some time and possibly disconnect from the irc network. You could of course tell wget to run in bg-mode using the -b flag, which would make the exec-command return instantly.

Another way is to use pipes with open, and then user fileevents to read any output from the command.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
pinkel
Voice


Joined: 21 May 2008
Posts: 8

PostPosted: Sat May 31, 2008 7:43 am    Post subject: Reply with quote

so someting like this will work?

Code:

[exec wget -O -b /var/www/temp/$filename $url]
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat May 31, 2008 3:20 pm    Post subject: Reply with quote

Yes, kind of. Since wget will return immediately, it really won't return anything useful, so I don't see any use for the [].

Edit:
To be abit more clear;
Code:
set somevar [exec wget -b -O /var/www/temp/$filename $url]

This will not produce much interesting information into somevar, and you might just aswell just do like this:
Code:
exec wget -b -O /var/www/temp/$filename $url

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Elfriede
Halfop


Joined: 07 Aug 2007
Posts: 67

PostPosted: Wed Feb 10, 2010 7:27 pm    Post subject: Reply with quote

i know an old thread, but how to make that run completely in the background or minimized? can someone please help

Code:

set somevar [exec wget -b -O /var/www/temp/$filename $url]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber