Display file text one page at a time, wait 20 seconds, then auto-advance

Alan

This question is for AIX 7

I have been working on a monitor which will display several pages of text. Initially the end user wanted a scrolling list for which I constructed this:

IFS=''; cat plfeed | while read line; do echo $line; perl -e 'select(undef,undef,undef,.8)'; done

The end user has decided that they would rather display a page (24 lines) of output for a set amount of time (20 seconds for example). I know that more will let me display a page at a time, but it requires keyboard input which is not acceptable for my use-case.

tldr;

How can I automate the 'more' command, or build a similar function that will sleep between pages and then automatically advance?

meuh

This fairly standard awk should be ok on AIX

awk '{if(NR>1 && NR%24==1)system("sleep 20");print}'

As mentioned in the comments, if you want to exit on interrupt, you can replace the system() by

{if(system("sleep 20"))exit}

but it might not work on your OS.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Display text only for a couple seconds

분류에서Dev

auto edit a text file

분류에서Dev

JQuery TimeCircles - display minutes and seconds in one circle

분류에서Dev

batch - File last modification time with seconds

분류에서Dev

Display elements of an array with intervals one at the time

분류에서Dev

Bootstrap animation every 20 seconds

분류에서Dev

Replace text in one file and match in second file

분류에서Dev

Reading a Text file with arrays in it - to display in table

분류에서Dev

Transform seconds in time in PHP

분류에서Dev

JavaScript calculate time and seconds

분류에서Dev

DOS: Copy one file (oldest) at a time

분류에서Dev

Linux and DD - Infinite time to extract one file

분류에서Dev

How to display a custom text on MUI_PAGE_INSTFILES in NSIS

분류에서Dev

Use a button to display one array string at a time in Javascript

분류에서Dev

Two images to one pdf file one image per page

분류에서Dev

How to plus one in text file? (JAVA)

분류에서Dev

multiple python scripts one text file

분류에서Dev

Issue about socket.io real-time text display

분류에서Dev

Need to run .exe file for 7 seconds and then kill the exe while performing input and output in text files

분류에서Dev

Website text on one php page (multi language website)

분류에서Dev

Auto call a php function every 10 seconds

분류에서Dev

Cisco router auto restart in x seconds

분류에서Dev

Is there an alternative to using an NSTimer to display remaining time of audio file with AVAudioPlayer?

분류에서Dev

Convert time stamp to seconds in bash

분류에서Dev

How can I get the contents of a file one line at a time?

분류에서Dev

Auto size UILabel text

분류에서Dev

Cannot Display Multiple Entities of a xml File while I can display one

분류에서Dev

How to copy contents of one text file to another with reduced length?

분류에서Dev

Condense all my snippets into one file in Sublime Text 3

Related 관련 기사

  1. 1

    Display text only for a couple seconds

  2. 2

    auto edit a text file

  3. 3

    JQuery TimeCircles - display minutes and seconds in one circle

  4. 4

    batch - File last modification time with seconds

  5. 5

    Display elements of an array with intervals one at the time

  6. 6

    Bootstrap animation every 20 seconds

  7. 7

    Replace text in one file and match in second file

  8. 8

    Reading a Text file with arrays in it - to display in table

  9. 9

    Transform seconds in time in PHP

  10. 10

    JavaScript calculate time and seconds

  11. 11

    DOS: Copy one file (oldest) at a time

  12. 12

    Linux and DD - Infinite time to extract one file

  13. 13

    How to display a custom text on MUI_PAGE_INSTFILES in NSIS

  14. 14

    Use a button to display one array string at a time in Javascript

  15. 15

    Two images to one pdf file one image per page

  16. 16

    How to plus one in text file? (JAVA)

  17. 17

    multiple python scripts one text file

  18. 18

    Issue about socket.io real-time text display

  19. 19

    Need to run .exe file for 7 seconds and then kill the exe while performing input and output in text files

  20. 20

    Website text on one php page (multi language website)

  21. 21

    Auto call a php function every 10 seconds

  22. 22

    Cisco router auto restart in x seconds

  23. 23

    Is there an alternative to using an NSTimer to display remaining time of audio file with AVAudioPlayer?

  24. 24

    Convert time stamp to seconds in bash

  25. 25

    How can I get the contents of a file one line at a time?

  26. 26

    Auto size UILabel text

  27. 27

    Cannot Display Multiple Entities of a xml File while I can display one

  28. 28

    How to copy contents of one text file to another with reduced length?

  29. 29

    Condense all my snippets into one file in Sublime Text 3

뜨겁다태그

보관