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?
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] 삭제
몇 마디 만하겠습니다