![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Put the output of grep in a variable | big123456 | Shell Programming and Scripting | 3 | 04-23-2008 08:40 AM |
| output of grep | useless79 | Shell Programming and Scripting | 3 | 09-18-2007 02:36 AM |
| substitute the grep output | jasmeet100 | Shell Programming and Scripting | 1 | 10-11-2005 04:40 PM |
| pausing a script | gozer13 | Shell Programming and Scripting | 6 | 04-19-2005 01:58 PM |
| Strange output from grep | Bab00shka | UNIX for Dummies Questions & Answers | 10 | 11-09-2004 03:23 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Pausing a Grep output
I am writing a small script which allows users to grep multiple log files across multiple directories, and often the output produced by the grep statements is quite lengthy. It would be nice if the output to the screen could be "paused" when it reaches a certain length (say, the length of the screen), and resumed once the user hits a key. I would rather not output the results to a file, but if the screen output cannot be tamed I may have no choice.
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
grep problem
use
grep "var" filename | less |
|
#3
|
||||
|
||||
|
use
| more after your 'grep' commands |
|
#4
|
|||
|
|||
|
grep command
Use
grep command | less as ' less ' has more capabilities than ' more ' . |
|
#5
|
||||
|
||||
|
But less is available on fewer systems than more.
Cheers ZB |
|
#6
|
|||
|
|||
|
I would strongly discourage any such thing.
If the user wants to have the output paginated he can pipe itself through "pg", "more", "less" or whatever is his favourite paginating program. If the user wants to use the output in any other way (like: capture it in a file, feed it to another program in a pipe, ...) the usage of a paginating software inside the script would prevent all these possibilities. bakunin |
|||
| Google The UNIX and Linux Forums |