klayout batch mode interfacing with other programs

Klayout running in batch mode using -b to run a drc script write output using puts function, the thing is, puts does not write to stdout, it writes to the terminal tty directly; making it impossible for a calling script to read the printed data which might be useful to track progress.

In the included screenshot, how do I suppress the green output, and how do I make the white output written to stdout instead of tty.


  • edited May 2021

    Proof of the contrary:

    $ cat x.drc
    puts "hello, world!"
    $ klayout -b -r x.drc >x.txt
    $ cat x.txt
    hello, world!

    There is no "writing to tty" inside KLayout.

    Green text comes from ANSI codes KLayout inserts when connected to a tty. When redirecting to a file no such thing happens.


Sign In or Register to comment.