SH

shmore(){ local l L M="`echo;tput setab 4&&tput setaf 7` --- SHMore --- `tput sgr0`";L=2;while read l;do echo "${l}";((L++));[[ "$L" == "${LINES:-80}" ]]&&{ L=2;read -p"$M" -u1;echo;};done;}
cat mod_log_config.c | shmore or shmore < mod_log_config.c Most pagers like less, more, most, and others require additional processes to be loaded, additional cpu time used, and if that wasn't bad enough, most of them modify the output in ways that can be undesirable. What I wanted was a "more" pager that was basically the same as running: cat file Without modifying the output and without additional processes being created, cpu used, etc. Normally if you want to scroll the output of cat file without modifying the output I would have to scroll back my terminal or screen buffer because less modifies the output. After looking over many examples ranging from builtin cat functions created for csh, zsh, ksh, sh, and bash from the 80's, 90s, and more recent examples shipped with bash 4, and after much trial and error, I finally came up with something that satisifed my objective. It automatically adjusts to the size of your terminal window by using the LINES variable (or 80 lines if that is empty) so This is a great function that will work as long as your shell works, so it will work just find if you are booted in single user mode and your /usr/bin directory is missing (where less and other pagers can be). Using builtins like this is fantastic and is comparable to how busybox works, as long as your shell works this will work. One caveat/note: I always have access to a color terminal, and I always setup both the termcap and the terminfo packages for color terminals (and/or ncurses and slang), so for that reason I stuck the tput setab 4; tput setaf 7 command at the beginning of the function, so it only runs 1 time, and that causes the -- SHMore -- prompt to have a blue background and bright white text. This is one of hundreds of functions I have in my http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html">.bash_profile at http://www.askapache.com/">AskApache.com, but actually won't be included till the next update. If you can improve this in any way at all please let me know, I would be very grateful! ( Like one thing I want is to be able to continue to the next screen by pressing any key instead of now having to press enter to continue)
Sample Output
$ cat mod_log_config.c | shmore
or
$ shmore < mod_log_config.c

#  * Syntax:
#  *
#  *    TransferLog fn      Logs transfers to fn in standard log format, unless
#  *                        a custom format is set with LogFormat
#  *    LogFormat format    Set a log format from TransferLog files
#  *    CustomLog fn format

 --- SHMore ---

What Others Think

So if you didn't want color, or if you cant depend on tput being present on the system: shmore(){ local l L M="`echo` --- SHMore --- ";L=2;while read l;do echo "${l}";((L++));[[ "$L" == "${LINES:-80}" ]]&&{ L=2;read -p"$M" -u1;echo;};done;}
AskApache · 666 weeks and 3 days ago
Command line is an only website that helps you to create and detect computer work. Also you can check https://porncasino.co/strip-games-apps/ to get casino games easily. You can easily find yourself. Join their website for more information.
Lere1953 · 156 weeks and 5 days ago
Computer work http://chinesebuffetnearmenow.net Also you can check https://porncasino.co/strip-games-apps/ to get casino games easily. You can easily find yourself. Join their website for more information.
PatriciaAcevedo · 25 weeks and 2 days ago
Vinyl siding is a great way to take advantage of the energy efficiency, flexibility and durability of vinyl. The most popular residential siding brand is CertainTeed Vinyl Siding. Need to check this vinyl siding and get more new things about the siding. You'll find that Chris Vargo is a true expert when it comes to selecting the right type for your home, as well as finding the best installation company for the job.
Wiltionew1928 · 25 weeks and 1 day ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale pug puppies indiana Amazing! This blog looks just like my old one! It's on a completely different subject but it has pretty much the same layout and design. Wonderful choice of colors!
rahimhh21 · 21 weeks and 3 days ago
Wow, this is the best fall guys article I've ever read.
marianrulia · 20 weeks and 3 days ago
May encrypted files secure your data. Disadvantages of free crypter: #1: Most of these free download Crypter are virus-infected, so free ... free crypter
Geekstation · 18 weeks ago
Kroger Feedback is a survey by the popular retail store (grocery store). With the following Official site www.krogerfeeback.com and 50 Fuel Points Bonus. http://www.rohitab.com/discuss/user/98534-krogerfeedbackcom">http://www.rohitab.com/
Geekstation · 17 weeks and 4 days ago
Guns Inc Shop was founded at the end of the ’80s and has been active ever since as a leading company in the field of Defense equipment. 15 RED DOT ar
Geekstation · 17 weeks and 3 days ago
Crypter malware is a encryption tool to encrypt or obfuscate codes. This encryption software encrypt malware and help hacker to bypass antivirus ... RAT trojan
Geekstation · 17 weeks and 2 days ago
Kikvape style, acquire as well as produce different goods plus instruments for your vaporization with important oils. Our current product range incorporates rosin push, ... dab press
Geekstation · 17 weeks ago
Matter-of-fact Play. Gates Regarding Olympus. Jam Gacor : 22:00 - 01:00 WIB. Pola Slot Gacor : Rotate Cepat 30x ON DC (???); Spin Turbocompresseur 10x OFF DC ... http://nripja.com/uploads/user/2022-10-01-021653.774701slothokiasia.html/">slot hoki asia
Geekstation · 16 weeks and 4 days ago
Internal audit services in UAE now provide independent and advanced strategies to overcome new risks and help businesses operate effectively. internal audit services in UAE
Geekstation · 15 weeks and 2 days ago
Thank you again for all the knowledge you distribute,Good post. I was very interested in the article, it's quite inspiring I should admit. I like visiting you site since I always come across interesting articles like this one.Great Job, I greatly appreciate that.Do Keep sharing! Regards, cenforce 100
Geekstation · 15 weeks and 2 days ago
Vapedubaiking is usually a reliable dealer along with ensures service delivery having great services. Will you be operating out of UAE and desire same-day supply? Consequently spot a person's get ... Vape shop in dubai
Geekstation · 15 weeks ago
The good thing is of which Vape zoom UAE, the top vape shop in Dubai, focuses primarily on offering you hundreds of products and solutions in fantastic costs. Smooth Disposable
Geekstation · 14 weeks and 6 days ago
Any time you're also shopping for a way to examine the speed of this web connection, MIDCO's on the net quickness examine is definitely an easy technique of doing that. Midcospeedtest.com
Geekstation · 14 weeks and 2 days ago
Imaginative USA H2o Salvaging Unit, Buy Waters Keeping Bathe Minutter On line USA, from very affordable price here at Shower Boss. Call us 914 488-4402. shower Timer Products for Sale USA
Geekstation · 14 weeks ago
Stable Environment friendly would be the Tangible installation within san diego for you to get in touch with when you require anything from modest problems to entire replacements. http://solidgreenconstruction.com/services/lawns-turf-installation/">turf installation San Diego
Geekstation · 14 weeks ago
Make use of any time you have ended in order to make the best try it is possible to in any queries you have not done. Calculators will not be used. 11 plus tutors
Geekstation · 14 weeks ago
I've just decided to create a blog, which I have been wanting to do for a while. Thanks for this post, it's really useful! Aluminum wax
Geekstation · 14 weeks ago
I just couldn't leave your website before telling you that I truly enjoyed the top quality info you present to your visitors? Will be back again frequently to check up on new posts. slot gacor
Geekstation · 13 weeks and 4 days ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me USA USA USA USA USA USA Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies baby pug puppies for sale pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale
Perfecthomepugs · 12 weeks and 5 days ago
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. interior design
Geekstation · 12 weeks and 4 days ago
This is highly informatics, crisp and clear. I think that everything has been described in systematic manner so that reader could get maximum information and learn many things. 16 volt battery
Geekstation · 12 weeks and 2 days ago
Your website is really cool and this is a great inspiring article. Thank you so much. Wedding Bands
Geekstation · 12 weeks and 2 days ago
Your website is really cool and this is a great inspiring article. RTP live hari ini
Geekstation · 11 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Similar Commands


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: