While running simple_curse.sh in RHEL 7 & RHEL 8. I found a issue that "bsc_cols=$(tput cols)" variable is getting set as 80 in RHEL 7 while actual "$(tput cols) value is 183" see below example. In RHEL8 I didn't find this issue as "echo $(tput cols) is 182 & bsc_cols=182" as well
Hi,
While running simple_curse.sh in RHEL 7 & RHEL 8. I found a issue that "bsc_cols=$(tput cols)" variable is getting set as 80 in RHEL 7 while actual "$(tput cols) value is 183" see below example. In RHEL8 I didn't find this issue as "echo $(tput cols) is 182 & bsc_cols=182" as well
In RHEL 7.7
bash -x one.sh ++ dirname one.sh
. ./../simple_curses.sh +++ bsc_create_buffer +++ '[' -d /dev/shm ']' +++ BUFFER_DIR=/dev/shm +++ local buffername +++ [[ '' != '' ]] +++ buffername=bashsimplecurses ++++ which mktemp +++ '[' -x /bin/mktemp ']' +++ mktemp /dev/shm/bashsimplecurses.XXXXXXXXXX ++ BSC_BUFFER=/dev/shm/bashsimplecurses.DzvxjIXkYc +++ bsc_create_buffer stderr +++ '[' -d /dev/shm ']' +++ BUFFER_DIR=/dev/shm +++ local buffername +++ [[ stderr != '' ]] +++ buffername=stderr ++++ which mktemp +++ '[' -x /bin/mktemp ']' +++ mktemp /dev/shm/stderr.XXXXXXXXXX ++ BSC_STDERR=/dev/shm/stderr.GRIDOc7Qxb ++ BSC_SIGINT=0 ++ trap bsc_on_kill SIGTERM ++ trap bsc_flag_sigint SIGINT ++ _TL='\033(0l\033(B' ++ _TR='\033(0k\033(B' ++ _BL='\033(0m\033(B' ++ _BR='\033(0j\033(B' ++ _SEPL='\033(0t\033(B' ++ _SEPR='\033(0u\033(B' ++ _VLINE='\033(0x\033(B' ++ _HLINE='\033(0q\033(B' ++ _DIAMOND='\033(00\033(B' ++ _BLOCK='\033(01\033(B' ++ _SPINNER=('-' '\' '|' '/') ++ [[ ./../simple_curses.sh == \o\n\e.\s\h ]]
main_loop -t 30
parse_args -t 30
BSC_MODE=dashboard
VERBOSE=1
BSC_TITLECROP=0
time=1
[[ 2 -gt 0 ]]
case "$1" in
time=30
shift 2
[[ 0 -gt 0 ]]
bsc_term_init
'[' dashboard == dashboard ']'
tput clear
bsc_init_chars
[[ -z '' ]]
[[ en_US.UTF-8 =~ .*.UTF-8 ]]
BSC_ASCIIMODE=utf8
[[ utf8 != '' ]]
[[ utf8 == \a\s\c\i\i ]]
[[ utf8 == \u\t\f\8 ]]
_TL='\xE2\x94\x8C'
_TR='\xE2\x94\x90'
_BL='\xE2\x94\x94'
_BR='\xE2\x94\x98'
_SEPL='\xE2\x94\x9C'
_SEPR='\xE2\x94\xA4'
_VLINE='\xE2\x94\x82'
_HLINE='\xE2\x94\x80'
_DIAMOND='\xE2\x97\x86'
_BLOCK='\xE2\x96\x88' ++ type -t update
'[' '' == function ']'
update_fn=sleep
'[' dashboard == dashboard ']'
trap 'tput clear' WINCH
true
reset_layout
BSC_COLLFT=0
BSC_COLWIDTH=0
BSC_COLWIDTH_MAX=0
BSC_WLFT=0
BSC_WNDHGT=0
BSC_COLHGT=0
BSC_COLBOT=0
BSC_COLHGT_MAX=0
BSC_NEWWIN_TOP_REQ=0
BSC_NEWWIN_RGT_REQ=0
echo -n ''
rm -f /dev/shm/stderr.GRIDOc7Qxb
'[' dashboard == dashboard ']'
tput clear
tput cup 0 0
main
tput cud 0 ++ tput cols
tput cub 183
sigint_check
'[' 0 -eq 1 ']'
cat /dev/shm/bashsimplecurses.DzvxjIXkYc ┌──────────────────────────────────────────────┐┌──────────┐┌──────────┐ │ TP ││ KPI ││ KPI_gxgy │ ├──────────────────────────────────────────────┤├──────────┤├──────────┤ │ ││Default_Be││APN_GX_CCR│ └──────────────────────────────────────────────┘│arer_SR_PG││ _SR │ │ W ││(582466/58│ │(142107/14││2470)100.0│ │2098)100.0││ % │ │ 1% ││APN_GX_CCR│ │GTP_Create││ _SR │ │_Session_S││(261837/26│ │ R_PGW ││2881)99.6%│ │(618855/63││APN_GY_CCR│ │0017)98.23││ _SR │ │ % ││(544877/54│ │GTP_Modify││6057)99.78│ │_Bearer_SR││ % │ │ _PGW ││APN_GY_CCR│ │(12207051/││ _SR │ │12211398)9││(194788/19│ │ 9.96% ││5128)99.83│ │GTP_Update││ % │ │_Bearer_SR│└──────────┘ │ _PGW │ │(206178/21│ │0374)98.01│ │ % │ │GTP_Create│ │_Bearer_SR│ │ _PGW │ │(125784/12│ │5936)99.88│ │ % │ └──────────┘ ┌──────────────────────────────────────────────┐ │ Monitoring │ ├──────────────────────────────────────────────┤ │ │ └──────────────────────────────────────────────┘
'[' 1 -gt 0 ']'
'[' -f /dev/shm/stderr.GRIDOc7Qxb ']'
cat /dev/shm/stderr.GRIDOc7Qxb
window TP cyan 60%
local title
local color
local bgcolor
title=TP
color=cyan
bgcolor=
'[' 1 -eq 2 ']'
case "$BSC_NEWWIN_TOP_REQ$BSC_NEWWIN_RGT_REQ" in
BSC_NEWWIN_TOP_REQ=0
BSC_NEWWIN_RGT_REQ=0
BSC_WNDHGT=0 **++ tput cols
bsc_cols=80**
case $3 in ++ echo 60% ++ sed s/%//
w=60
bsc_cols=48
'[' 48 -lt 3 ']'
BSC_COLWIDTH=48
'[' 48 -gt 0 ']'
BSC_COLWIDTH_MAX=48 ++ head -c 48 /dev/zero ++ tr '\0' ' '
BSC_BLANKLINE=' '
BSC_LINEBODY=' '
contentLen=46
BSC_LINEBODY='\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x0\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\E2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2\x94\x80\xE2x94\x80\xE2\x94\x80'
========================== In RHEL 8.3
[[ utf8 == \a\s\c\i\i ]]
[[ utf8 == \u\t\f\8 ]]
_TL='\xE2\x94\x8C'
_TR='\xE2\x94\x90'
_BL='\xE2\x94\x94'
_BR='\xE2\x94\x98'
_SEPL='\xE2\x94\x9C'
_SEPR='\xE2\x94\xA4'
_VLINE='\xE2\x94\x82'
_HLINE='\xE2\x94\x80'
_DIAMOND='\xE2\x97\x86'
_BLOCK='\xE2\x96\x88' ++ type -t update
'[' '' == function ']'
update_fn=sleep
'[' dashboard == dashboard ']'
trap 'tput clear' WINCH
true
reset_layout
BSC_COLLFT=0
BSC_COLWIDTH=0
BSC_COLWIDTH_MAX=0
BSC_WLFT=0
BSC_WNDHGT=0
BSC_COLHGT=0
BSC_COLBOT=0
BSC_COLHGT_MAX=0
BSC_NEWWIN_TOP_REQ=0
BSC_NEWWIN_RGT_REQ=0
echo -n ''
rm -f /dev/shm/stderr.tuROv7n8yn
'[' dashboard == dashboard ']'
tput clear
tput cup 0 0
main
tput cud 0 ++ tput cols
tput cub 182
sigint_check
'[' 0 -eq 1 ']'
cat /dev/shm/bashsimplecurses.AqWW49t3zZ ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────┐┌─────────────────────────┐┌─────────────────────────┐ │ TP ││ KPI ││ KPI_gxgy │ ├───────────────────────────────────────────────────────────────────────────────────────────────────────────┤├─────────────────────────┤├─────────────────────────┤ │ --------------------------------------------------------------------------------------------------------- ││ Default_Bearer_SR_PGW ││ APN_GX_CCR_SR │ │ S1U SGI S5-SGW S5-PGW DL UL ││ (143701/143690)100.01% ││ (579520/579529)100.0% │ │ --------------------------------------------------------------------------------------------------------- ││GTP_Create_Session_SR_PGW││ APN_GX_CCR_SR │ │ 635.37 2954.20 2442.50 46.06 5396.70 681.43 ││ (606396/617942)98.13% ││ (259688/260532)99.68% │ │ 911.52 6847.43 2437.26 108.99 9284.69 1020.51 ││GTP_Modify_Bearer_SR_PGW ││ APN_GY_CCR_SR │ │ 760.17 5224.95 2008.22 91.76 7233.17 851.93 ││(12829063/12834696)99.96%││ (542715/543871)99.79% │ │ 742.75 5280.52 1846.78 59.15 7127.29 801.90 ││GTP_Update_Bearer_SR_PGW ││ APN_GY_CCR_SR │ │ 0.00 0.00 0.00 0.00 0.00 0.00 ││ (206055/210285)97.99% ││ (188679/189000)99.83% │ │ 785.70 5571.94 2200.49 82.52 7772.43 868.22 ││GTP_Create_Bearer_SR_PGW │└─────────────────────────┘ │ 929.32 6421.38 2230.85 111.18 8652.23 1040.50 ││ (164545/164752)99.87% │ │ 831.10 5752.37 2302.47 85.17 8054.84 916.27 │└─────────────────────────┘ │ 747.86 4889.43 2116.23 61.28 7005.66 809.14 │ │ 0.00 0.00 0.00 0.00 0.00 0.00 │ │ --------------------------------------------------------------------------------------------------------- │ │ Totals ----------- 6343.79 42942.22 17584.80 646.11 60527.01 6989.90 │ │ --------------------------------------------------------------------------------------------------------- │ │ Total UL + DL: 67516.91 │ │ --------------------------------------------------------------------------------------------------------- │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────┘ ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Monitoring │ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ CRITICAL (x.xx.xx.xx) ::[SYSLOG] Syslog is Active and not updating for [x.xx.xx.xx] │ │ [SYSLOG] Syslog is Active and updating for [x.xx.xx.xx] [x.xx.xx.xx] │ │ CRITICAL - cdf-1(x.xx.xx.xx) ::[CD] │ │ Response_Message Type Initial ResultCode[xxx] on Gx │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
'[' 1 -gt 0 ']'
'[' -f /dev/shm/stderr.tuROv7n8yn ']'
cat /dev/shm/stderr.tuROv7n8yn
window TP cyan 60%
local title
local color
local bgcolor
title=TP
color=cyan
bgcolor=
'[' 1 -eq 2 ']'
case "$BSC_NEWWIN_TOP_REQ$BSC_NEWWIN_RGT_REQ" in
BSC_NEWWIN_TOP_REQ=0
BSC_NEWWIN_RGT_REQ=0
BSC_WNDHGT=0 **++ tput cols
bsc_cols=182**
case $3 in ++ echo 60% ++ sed s/%//
w=60
bsc_cols=109
'[' 109 -lt 3 ']'
BSC_COLWIDTH=109
'[' 109 -gt 0 ']'
BSC_COLWIDTH_MAX=109 ++ head -c 109 /dev/zero