As a simple example, I want to write a CLI script which can print = across the entire width of the terminal window.
#!/usr/bin/env php <?php echo str_repeat('=', ???);
or
#!/usr/bin/env python print '=' * ???
or
#!/usr/bin/env bash x=0 while [ $x -lt ??? ]; do echo -n '='; let x=$x+1 done; echo
tput colstells you the number of columns.tput linestells you the number of rows.