Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # if you need to scroll back to a certain fine combination _item maybe
- clear;
- if (( $# != 6 )); then
- echo "
- scroller.sh is used to scroll throughout a file ...
- usage: mode direction "up" or "down" _string
- start starting character _int ( relative to mode )
- size page size _int
- step characters step size _int
- interval sleep interval _int
- file targeted file _string
- "
- read x;
- exit;
- fi
- mode=$1;
- start=$2;
- size=$3;
- step=$4;
- sinterval=$5;
- file=$6;
- index=$(( $size + $start ));
- while true;
- do
- if (( $mode == "down" )); then
- cat $file | head -c $index | tail -c $size;
- fi
- if (( $mode == "up" )); then
- cat $file | tail -c $index | head -c $size;
- fi
- index=$(( "$index" + "$step" ));
- sleep $sinterval;
- clear;
- done
- #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement