Linux mint horizontal terminal scrolling

pcm81

Senior member
Mar 11, 2011
581
9
81
Greetings and salutations.
I am trying to see a rather long output, say 300 characters per line, in a command window. I am using a grep command on a collection of text files and they output matching records 1 per line.

Is there a terminal application that has horizontal scroll bars?
As it stands now the right most part of the output gets cut off, so i guess the word-wrap is off.

Thanks ahead
 

pcm81

Senior member
Mar 11, 2011
581
9
81
solution:
Not exactly what i was looking for, but here is a script that does the wordwrap based on window size for grep call:

#!/bin/bash

terminal=/dev/pts/1
columns=$(stty -a <"$terminal" | grep -Po '(?<=columns )\d+')
rows=$(stty -a <"$terminal" | grep -Po '(?<=rows )\d+')

spacer=$(cat /dev/urandom | tr -dc '=' | fold -w $columns | head -n 1)


#coment
grep $@ | sed -e "s/^.*$/&1 $spacer/" > hjfdtgdtfgkbhftgdgdytd.txt
fold -sw $columns hjfdtgdtfgkbhftgdgdytd.txt
rm hjfdtgdtfgkbhftgdgdytd.txt




exit 0