Since TV does not support any control structures like loops or branchings an extension was programmed to send commands to TV from any script language. The program that fulfills this is called STV (stands for send tv). For example
i=1; while `test ${i} != 8`; do stv "tv> s ${i}.spc"; i=`expr ${i} + 1`; done
started from a shell, loads 7 spectra. STV sends commands only to TV's which are owned by the user running STV and waits for TV to finish the command before returning. Only the last one started TV receives the commands or you must explicitely define a portnumber. This is printed immediately after startup of TV and saved in the file ~/.tv-port. If you want to send commands to TV with portnumber 10000 you enter for example:
i=1; while `test ${i} != 8`; do stv "tv> s ${i}.spc" 10000; i=`expr ${i} + 1`; done
TV shell commands like "%rm -rf ~" sent by STV are ignored.