set script_bin {/home/egg/scripts/script.sh}
set my_channel "#chan"

proc script_proc_bind_cmd {nick uhost hand chan text} {
         if {![string equal [lrange [split $text] 0 1] "hello world"]} {return}
         set text [lrange [split $text] 2 end]
         set output [exec $::script_bin [lindex $text 0]]
         putserv "PRIVMSG $my_channel :$output"
}

bind pubm -|- "*hello world*" script_proc_bind_cmd