LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-13-2008, 01:31 PM   #1
Romanus81
Member
 
Registered: Feb 2008
Posts: 201

Rep: Reputation: 31
bash: Can I print new information on allready printed lines?


Is there any method within cli user interfaces to have a script have something like this:


texttexttexttexttexttext
texttexttexttexttexttext
texttexttexttexttexttext
texttexttexttexttexttext
<line currently on>

and then print a line such that

texttexttexttexttexttext <new text>
texttexttexttexttexttext <new text>
texttexttexttexttexttext <new text>
texttexttexttexttexttext
<line currently on>

Almost as if there was another console on top of the first one.
Is there any way to do this other than issuing clear and having it print all the lines over again?
 
Old 11-13-2008, 02:12 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Take a look at tput. It can do a lot more then you ask. You can (also) make 'complicated' (from a cli point of view) data entry menu's with it.

Here are a few links:

HowTo: Use tput in a shell data entry system - Part 1 and part 2

Colours and Cursor Movement With tput (tldp.org)

Google will give you a lot more links.

Hope this helps.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use diff to only print lines fancylad Linux - General 10 06-17-2013 12:50 PM
Sed command to print matching lines and 2 lines above.. DX398 Programming 12 10-01-2008 08:25 AM
print the file: between the lines viveksnv Programming 3 02-26-2008 03:06 PM
getting sed to hold lines and print them out again- help please inonzi_prowler Linux - Software 3 02-21-2007 03:26 AM
How do I print using format that padded space between printed value ? Linh Programming 2 06-18-2004 03:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration