and a little example to start from:
#!/bin/sh
:SET &PASS# = GET_LOGIN(LOGIN.KREPROD.INFORMIX, informix, APP, PASSWORD)
pass=$(&UC_JOBMD CMD="echo &PASS#")
###pass=$( /opt/automic/agent/bin/ucxj???m CMD="echo &PASS#" )
###pass=$( /opt/automic/agent/bin/ucxjlx6m 'CMD=echo &PASS#' )
You can see it was made for bash; works almost the same way for any other scripting language.
Using &UC_JOBMD is pretty helpful, else you have to hardcode the (path to ) the messenger.
A common problem is quoting. If you see strange things, check single/double quotes backwards/forwards...