I can not restore by ontape via here doc when have more several log tapes
I use Informix7.30 UC2 on Solaris7 X86.
I backup logical log to disk then rename to a unique name by script that called by alarm program

LTAPEDEV /usr/home/dba/DEV/LDEVNAME
$> ls -l $HOME/DEV/LDEVNAME
lrwxrwxrwx 1 informix informix 25 Aug 22 2001 /usr/home/dba/DEV/LDEVNAME -> /usr/home/dba/JNL/worklog
$> ls -lt $HOME/JNL
total 3728
-rw-rw---- 1 informix informix 0 Feb 10 15:49 worklog
-rw-rw---- 1 dba informix 376832 Feb 10 15:48 worklog.Mon.15:48
-rw-rw---- 1 dba informix 163840 Feb 8 10:51 worklog.Sat.10:51
-rw-rw---- 1 dba informix 212992 Feb 7 15:50 worklog.Fri.15:50
-rw-rw---- 1 dba informix 294912 Feb 6 15:50 worklog.Thu.15:50
-rw-rw---- 1 dba informix 655360 Feb 5 15:49 worklog.Wed.15:49

I would like to develop script restore, because ontape difficult to use by manually.
But here doc can not link log tapes in appropriate time. For example of heredoc is:

ontape -r << !
enter
y
y
enter
y
19
n
`rm /usr/home/dba/DEV/LDEVNAME`
`ln -s /usr/home/dba/JNL/worklog.Sat.10:51 /usr/home/dba/DEV/LDEVNAME`
y
enter
`rm /usr/home/dba/DEV/LDEVNAME`
`ln -s /usr/home/dba/JNL/worklog.Mon.15:48 /usr/home/dba/DEV/LDEVNAME`
y
enter
`rm /usr/home/dba/DEV/LDEVNAME`
`ln -s /usr/home/dba/JNL/worklog /usr/home/dba/DEV/LDEVNAME`
y
enter
n
!

How can I develop restore database script (without restore by manually)?
Beside here doc, Can I use another utilities?
Please recommend me?Thank you for your kindness.