All output to terminal pager by default


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting All output to terminal pager by default
# 1  
Old 12-13-2015
All output to terminal pager by default

How can I have all my output to a terminal pager by default.
I want all output to pause once screen is full.

Piping to more does not work if the app/script is interactive
# 2  
Old 12-13-2015
You could write all 'output' between interactions into files or pipe to pager, print them, followed by the interaction command, then print the next according file to pager, etc.
Issue remains, while within the pager, the user cannot do interactions.

My question is this much output really required for interactions?
As example, make a detailed --help, --docs --manpage output that is printed to ${PAGER:-more} (bash).
Then focus on the interactions on 'minimal' output to describe what is done with the user input.

Last but not least, you could write your own output function, checking $LINES for the max lines displayed, and then count each line printed, then echo "press enter to continue";read buffer to continue after setting the line count to 0.

hth
# 3  
Old 12-13-2015
If you're saying that you want to type characters into your terminal and magically have the system guess which characters you type are supposed to be read by a pager and which characters you type are supposed to be read by the application that is sending data to the pager; that isn't going to happen. If you have two programs concurrently reading characters from your terminal, havoc is almost guaranteed. Smilie

With more and some other pagers, if standard output is a terminal, the pager will read user interaction input from standard error. So, you could rewrite your application to read application and pager commands from standard input and forward commands for the pager to the pager using a pipeline it connects to the pager's file descriptor 2. (Note that standard error from the pager in this case is a read-write channel [not write-only] and your application needs to be prepared to forward any diagnostics written by the pager to the user somehow [remembering that output being sent to the terminal is being controlled by the pager; not by your application].)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print Terminal Output Exactly how it Appears in the Terminal to a New Text File

Hello All, I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly. Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies

2. Shell Programming and Scripting

Redirect output from terminal

i make a shell script. There has a line wget https://cisofy.com/files/lynis-2.1.0-88394c1affb9e23bd7390098947b3fd4b04e35e8.tar.gzWhen this line execute terminal show some text like this Resolving cisofy.com (cisofy.com)... 149.*.*.* Connecting to cisofy.com (cisofy.com)|149.*.*.*|:4444...... (4 Replies)
Discussion started by: Devils-ey3
4 Replies

3. Shell Programming and Scripting

Pager Alert

I want to check the log file continoulsy and to send a page alert if i see specific message like Reached Max Connrctions . Please suggest how to do this through script DO i need to enable the cronjob to run the script evey 5 min or what is the best way (4 Replies)
Discussion started by: mskalyani9
4 Replies

4. Shell Programming and Scripting

Truncate terminal output

Hello Using BASH under Ubuntu 10.4 lts + XMonad My script is almost perfect but i'm stuck at the last hurdle: I need a sort of modified 'echo' which truncates its output to the width of the terminal I can find the terminal's width with 'stty size' but i dont know how to then convert input... (2 Replies)
Discussion started by: scyptnex
2 Replies

5. UNIX for Dummies Questions & Answers

Vim: Warning: Output is not to a terminal

I'm using Debian, connected via SSH using Putty, and trying to run the command: dpkg --configure -ato run a package that didn't complete due to my having to disconnect while it was running. It gives this message: dpkg: dependency problems prevent configuration of php5-dev: php5-dev... (3 Replies)
Discussion started by: stulancs
3 Replies

6. AIX

mail, aliases, pager

Hi, I have two aliases for two types of alert. /etc/aliases italert1: user1@company.com italertb: 123456@paging.isp.com The first alias containts only an email to go through the company exchange/mail server. Works fine. The second alias contains only a pager which also works fine.... (2 Replies)
Discussion started by: itik
2 Replies

7. UNIX for Advanced & Expert Users

Terminal Output to a File ??

Hey, How can I transfer the terminal output to a file ? For example : command "fuser" returns the "process-id" and prints the output on the terminal, but I want that output to a file as well. How can I do that ? /clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor $ fuser -uf... (2 Replies)
Discussion started by: varungupta
2 Replies

8. Solaris

how to redirect my output in a new terminal

Hi all, i type a command along with dtterm what i would like to have is that the output of the command to be shown in the new terminal . Any Idea on how to acheive this? (0 Replies)
Discussion started by: Sayantan
0 Replies

9. Programming

output to terminal

How can I write to another user's pseudo tty, but not to its current prompt position (as in open("/dev/pts007", ...) followed by write() ). Instead I would like to write to the top center of the screen using color red, for example. Like curses, but from another console. (6 Replies)
Discussion started by: andreis
6 Replies

10. UNIX for Advanced & Expert Users

Pager message from UNIX

Hi, we have written an auto emailer script for some autosys jobs getting delayed using C-Shell. We would also like to enhance this by sending out a page to the support personnel. Is there any way in C-Shell or autosys wherein we have the facility to send these pager messages ? Please help !! (1 Reply)
Discussion started by: pavankri
1 Replies
Login or Register to Ask a Question