Created
October 25, 2018 16:24
-
-
Save eschen42/610e16008175e5b0be4dda83bbeb8cfd to your computer and use it in GitHub Desktop.
get tty columns on Debian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
export ROWCOL="$(stty -a | head -n 1 | grep columns | sed -n -e 's/speed [0-9]* baud; rows \([0-9]*\); columns \([0-9]*\);.*/export LINES=\1; export COLUMNS=\2 /; s/.*speed//; p')" | |
$ROWCOL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment