, , bash :
#!/bin/bash
MYTERMRESTORE=$(stty --save)
stty icanon -echo
columns=$(tput cols)
lines=$(tput lines)
buffer="$(ps aux)"
scroll="${#buffer}"
tput csr 1 "${lines}"
while [ "${#x}" -lt "$columns" ]
do x="$x="
done
printf "$x\n"
while [ 1 ]
do printf "%.*s" $scroll "$buffer"
printf "\n\nUse arrow keys to toggle through output, q to quit\n"
read -n 1 i
case "$i" in
'[')
read -n 1 j
case "$j" in
"A")
scroll=$(( scroll - $columns ))
;;
"B")
scroll=$(( scroll + $columns ))
;;
esac
;;
'q') break
;;
esac
done
stty "$MYTERMRESTORE"
, . select()
.
user4832408