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 Thu 31 Jul 2014, 13:41
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 [1 Post]  
Author Message
8-bit


Joined: 03 Apr 2007
Posts: 3357
Location: Oregon

PostPosted: Tue 27 Oct 2009, 18:58    Post subject:  Tailbox text handling
Subject description: 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 from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0408s ][ Queries: 12 (0.0036s) ][ GZIP on ]