Question

Suppose I've got a giant command

echo "start string `complexcommand -with -many args | cut -d ' ' -moreargs | sed 's/you/get/g' | grep -v "the idea" | xargs echo` ending string" | program | less -S 

It produces output of several hundred lines of many thousand characters in length.

less handles scrolling vertically quite well, as that's what it is used for most of the time, but scrolling left and right is very CPU taxing according to top and I am not aware of any "page-left" or "page-right" style commands to go faster.

So I'm hoping that something like zsh's built-in pager could handle this task faster, but I'm having trouble figuring out the command to use it. It takes a file input. Is there a way to make a oneliner use the pager rather than having to dump it to a file first?

Or if anybody has suggestions for better editors. I might try using vim next.

Was it helpful?

Solution

If you want to invoke zsh's pager, use some-complex-pipeline | zsh -c '< /dev/fd/0'. The /dev/fd/0 file is a device that represents the current process's standard input stream.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top