FIFO pipe

You can remote control WeeChat, by sending commands or text to a FIFO pipe (you have to enable option "irc_fifo_pipe", it is disabled by default).

The FIFO pipe is located in "~/.weechat/" and is called "weechat_fifo_xxxxx" (where xxxxx is the process ID (PID) of running WeeChat). So if many WeeChat are running, you have many FIFO pipes, one for each session.

The syntax for the FIFO pipe commands/text is:

server,channel *text or command here

where server and channel are optional, but if channel is here, server should be too.

Some examples:

You can write a script to send command to all running WeeChat at same time, for example:

#!/bin/sh
if [ $# -eq 1 ]; then
    for fifo in $(/bin/ls ~/.weechat/weechat_fifo_* 2>/dev/null); do
        echo -e "$1" >$fifo
    done
fi

If the script is called "auto_weechat_command", you can run it with:

$ ./auto_weechat_command "freenode,#weechat *hello"