Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display lines of a file screen by screen

Status
Not open for further replies.

jc223

Programmer
Dec 15, 2003
1
IE
Hi I am having problems with displaying text from a file screen by screen, so that each screen only shows one line from the file, and the user must press a button to go to the next screen.
This is my script:

cat test.txt | while read LINE
do

echo $LINE|more

done

Please tell me what is wrong with this, if you can. I think it has something to do with the more command, but am very new to Unix......


 
Hi,
More works by displaying $LINES-2 worth of text and then pausing. if $LINES isn't set then it uses ROWS from the STTY settings.

eswssol002:~ [111] stty -a
speed 9600 baud;
rows = 34; columns = 80; ypixels = 378; xpixels = 499;



If The length of the test is < $LINES more acts like CAT and doesn't pause.

You might try

setting LINES 3

LINES = 3 ; export LINES //ksh
setenv LINES 3 //csh

and then simply

more file

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top