Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to create a simple bash script that I can run over ssh that will display some basic system information using ncurses and the dialog command. I've tried two approaches so far:

1) Run dialog --infobox in a while loop with a 1 second sleep between redraws.

Problem: This displays properly however there is a brief flicker between redraws that I would like to eliminate

2) Run dialog --tailbox once and have it display the contents of a pre-populated system info file.

Problem: Unless the number of lines in the input file changes, the dialog doesn't update.

I'm wondering if there is a better way to draw a dialog box with constantly updating information. I'm also open to any other non ncurses suggestions if there is a better/easier way of doing this.

I will be displaying this through SSH on a small tablet so I would like to make it as visually appealing as possible while remaining within the terminal.

share|improve this question
    
Related: Repeat a unix command every x seconds forever –  Gilles Feb 29 '12 at 2:43
    
have you tried using the --sleep <secs> arg to dialog instead of in the while loop? –  bdowning Feb 29 '12 at 14:16
    
This is definitely a cleaner approach. Unfortunately the flicker issue is still there. Thanks –  Andrew Munro Feb 29 '12 at 14:31
add comment

1 Answer

I've recently discovered that using escape characters might be the easiest way to reliably accomplish this task.

This article outlines the purpose of each escape character and how to combine them to draw simple bash dialogs.

http://top-scripts.blogspot.com/2011/01/power-of-echo-command-bash-console.html

Thanks for the help thus far.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.