Language selection tool

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
User avatar
brokenman
Site Admin
Site Admin
Posts: 5575
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Language selection tool

Post#46 by brokenman » 13 Dec 2016, 15:37

But I know of no trick for any bash script to be able to read $COLUMNS

Code: Select all

#!/bin/bash

columns=$(tput cols)
echo "Columns: " $columns
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: Language selection tool

Post#47 by Rava » 22 Dec 2016, 19:55

tput, yes, I tend to forget about tput...

Also, this might be helpful as well:

Code: Select all

shopt -s checkwinsize
https://www.gnu.org/software/bash/manua ... iltin.html
checkwinsize

If set, Bash checks the window size after each command and, if necessary, updates the values of LINES and COLUMNS.

And then we have this:

Code: Select all

stty size
:D

Useful code: http://pastebin.com/uu9MaVbX
(I just read over it but I have not tested every line)
Cheers!
Yours Rava

Post Reply