View Single Post
  #1   (View Single Post)  
Old 5th December 2011
steamrent steamrent is offline
New User
 
Join Date: Dec 2011
Posts: 5
Default How do I run a shell command in a while loop?

Hi,

I am running an IRC client in OpenBSD and I choose sic because with such short amount of lines it seems very audit-able for security as opposed to larger clients such as irssi.

I usually perform:

Code:
sic -h irc.freenode.net 2>&1 | tee -a irc.log
I pipe the output of sic to tee in order to log my IRC sessions.

I'm trying to handle reconnects by running it in a while loop in the shell process and cat the initial commands into sic's stdin.

I would think to approach this by using a fifo (using the mkfifo(1) command) to redirect sic's stdin, but I'm not sure if there's a more elegant way to reconnect on ping timeouts, kills, servers going down, and just disconnects in general.

How do you suggest I go about doing this?
Reply With Quote