You could get the lines and columns from tput
:
#!/bin/bash
lines=$(tput lines)
columns=$(tput cols)
echo "Lines: " $lines
echo "Columns: " $columns
More Related Contents:
- How to reload .bashrc settings without logging out and back in again?
- Can I export a variable to the environment from a Bash script without sourcing it?
- What is the exact meaning of IFS=$’\n’?
- Can colorized output be captured via shell redirect? [duplicate]
- What does it mean in shell when we put a command inside dollar sign and parentheses: $(command)
- How to Batch Rename Files in a macOS Terminal?
- How to write a bash script to set global environment variable?
- Temporarily change current working directory in bash to run a command [duplicate]
- Why doesn’t my terminal output unicode characters properly?
- Is there a way to get my emacs to recognize my bash aliases and custom functions when I run a shell command?
- How do I set a variable to the output of a command in Bash?
- Bash tool to get nth line from a file
- ‘\r’: command not found – .bashrc / .bash_profile [duplicate]
- How can I use inverse or negative wildcards when pattern matching in a unix/linux shell?
- How to get a password from a shell script without echoing
- Exit Shell Script Based on Process Exit Code [duplicate]
- How can I use Bash syntax in Makefile targets?
- Delete files older than 10 days using shell script in Unix [duplicate]
- Simulating ENTER keypress in bash script
- Passing arguments by reference
- How do I pause my shell script for a second before continuing?
- How do you echo a 4-digit Unicode character in Bash?
- How to find whether or not a variable is empty in Bash
- Docker: How to use bash with an Alpine based docker image?
- How to get the list of files in a directory in a shell script?
- Bash shell Decimal to Binary base 2 conversion
- VSCode Integrated Terminal Doesn’t Load .bashrc or .bash_profile
- How to substitute quoted, multi-word strings as arguments?
- How does one change the language of the command line interface of Git?
- How to set uid and gid in Docker Compose?