Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 Oct 2014, 01:11
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Tailbox text handling
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count_1  
Author Message
8-bit


Joined: 03 Apr 2007
Posts: 3382
Location: Oregon

PostPosted: Tue 27 Oct 2009, 18:58    Post_subject:  Tailbox text handling
Sub_title: Formatting text befor display in tailbox window
 

I got tailing to work after a fashion.
But I am having a problem with output from an external program that overwrites some lines it displays.
The output to the tailbox window currrently shows all lines individually rather than overwriting some as it should.
What should I change in this sample program?

Code:
#!/bin/sh

export TITLE="Test run"
export TAILFILE=/tmp/mine
ufiformat -v /dev/sde> $TAILFILE&
#mkdosfs -v -I /dev/sde&> $TAILFILE
echo 99 > /tmp/tailbox_progress
echo " " > /tmp/tailbox_text

tailing (){
   I=`cat /tmp/tailbox_progress`
   echo $TITLE
   echo $I
   sleep 1
   [ -s "$TAILFILE" ] && tail -n 20 "$TAILFILE" | tr '\r' '\n' | tail -n 20 > /tmp/tailbox_text
   echo 100 > /tmp/tailbox_progress
}
export -f tailing

export tailbox="
<window title=\"tailbox\">
 <vbox>
  <progressbar>
   <input>"'while [ A != B ]; do tailing; done'"</input>
   <action>refresh:TAIL</action>
   <action>echo 99 > /tmp/tailbox_progress</action>
  </progressbar>
  <edit>
   <variable>TAIL</variable>
   <input file>/tmp/tailbox_text</input>
   <width>300</width><height>200</height>
  </edit>
 </vbox>
</window>"

I=$IFS; IFS=""
for STATEMENTS in $(gtkdialog3 -p tailbox); do
   eval $STATEMENTS
done
IFS=$I
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0762s ][ Queries: 11 (0.0404s) ][ GZIP on ]