Written by

Senior Cloud Architect at InterSystems
MOD
Question Eduard Lebedyuk · Feb 11

Automatically piping commands to stdout

When I build docker containers my build log usually looks like this:

#924.94 Using 'iris.cpf' configuration file
#925.82
#927.55 Starting Control Process
#927.55 Global buffer setting requires attention.  Auto-selected 25% of total memory.
#927.55 Allocated 4999MB shared memory
#927.553915MB global buffers, 391MB routine buffers
#929.84 This copy of InterSystems IRIS has been licensed foruse exclusively by:
#929.84 No local key detected, trying license server.
#929.84 Copyright (c) 1986-2026 by InterSystems Corporation
#929.84 Any other use is a violation of your license agreement
#9140.1
#9140.12 alert(s) during startup. See messages.log for details.
#9140.2 Merging IRIS, please wait...
#9140.2 Starting IRIS
#9140.2
#9140.3
#9140.3 Node: buildkitsandbox, Instance: IRIS
#9140.3
#9140.3 USER>
#9140.3
#9140.3%SYS>
#9140.3
#9140.3%SYS>
#9140.3
#9140.3%SYS>
#9141.3
#9141.3%SYS>
#9141.3
#9141.3%SYS>
#9141.3
#9141.3%SYS>
#9141.3
#9141.3%SYS>
#9141.4
#9141.4 Load started on 02/12/202600:51:17
#9141.4 Loading file /home/irisowner/dev/CPF.xml as xml
#9141.8 Imported class: User.CPF
#9141.9 Compiling class User.CPF
#9142.2 Compiling routine User.CPF.1
#9142.2 Load finished successfully.
#9142.2
#9142.2%SYS>
#9142.2
#9142.2%SYS>
#9142.2
#9142.2%SYS>
#9142.2
#9142.2%SYS>
#9142.2
#9142.2%SYS>
#9142.2
#9142.2%SYS>
#9142.2
#9142.2%SYS>
#9142.2
#9142.2%SYS>
#9142.2
#9142.2%SYS>
#9142.2
#9142.2%SYS>
#9142.3
#9142.3 Load of directory started on 02/12/202600:51:18
#9142.3
#9142.3 Loading file /home/irisowner/dev/src/%ZSTART.macas udl
#9142.3%ZSTART.MAC Loaded
#9144.4%SYS>
#9144.4 <ENDOFFILE>
#9144.4 <ERRTRAP>

Is there any way to record commands? Currently I need to add:

write"About to try ABC"

But it would be way better if I could just see what's being executed.

Product version: IRIS 2025.3

Comments

Dmitry Maslennikov · Feb 19

A bit hackish way

{
  while IFS= read -r line; doecho'write *27,"[1F",$namespace,">", "'$(echo$line | sed "s/\"/\"\"/g" )'",*27,"[1F"'printf'%s\n'"$line"done
} <<'EOF' | iris session iris
write $zv
write !,"hello ", $username,!
zn "%sys"
halt
EOF

and output

$ bash test.sh 

Node: e91a00f6512e, Instance: IRIS

USER>write $zv
IRIS for UNIX (Ubuntu Server LTS for ARM64 Containers) 2026.1.0L (Build 193U) Tue Jan 6 2026 01:46:47 EST
USER>write !,"hello ", $username,!

hello irisowner

USER>zn "%sys"

%SYS>halt
0