yes $COLUMNS $LINES|awk 'BEGIN{x=y=e=f=1}{if(x==$1||!x){e*=-1};if(y==$2||!y){f*=-1};x+=e;y+=f;printf "\033[%s;%sH",y,x;for (a=0;a<400000;a++){}}' # Make your cursor bounce around the terminal. The 400000 in the for loop is just a busy delay. Adjust as needed.


man bash | sed 's/./&\n/g' | awk -v mx=$COLUMNS -v my=$LINES 'BEGIN{x=y=e=f=1}{if(x==mx||!x){e*=-1};if(y==my||!y){f*=-1};x+=e;y+=f;printf "\033[%s;%sH%s",y,x,$1;for (a=0;a<400000;a++){}}' # Print the bash man page in diagonal lines across the screen.

@climagic this reminds me of the shit i'd write in qbasic when i was a kid

Lol, me too, that was my first actual functional QBasic program - bouncy asterisk "screensaver"

@climagic All I see is elder script bleeding into our world.

@climagic this is the most useful piece of code I've ever seen in my life.

A version that accepts any output:


LINES=$(tput lines)
COLUMNS=$(tput cols)
if [ $# -eq 0 ]; then ARGS='man bash'; fi
bash -c "$ARGS" | sed 's/./&\n/g' | awk -v mx=$COLUMNS -v my=$LINES 'BEGIN{x=y=e=f=1}{if(x==mx||!x){e*=-1};if(y==my||!y){f*=-1};x+=e;y+=f;printf "\033[%s;%sH%s",y,x,$1;for (a=0;a<400000;a++){}}'

@k @climagic line returns are a lot tricker in openbsd sed and awk wants a fflush().

and use a real man page :)

Try this version.

man pf.conf | sed 's/./&\
/g' | awk -v mx=$COLUMNS -v my=$LINES 'BEGIN{x=y=e=f=1}{if(x==mx||!x){e*=-1};if(y==my||!y){f*=-1};x+=e;y+=f;printf "\033[%s;%sH%s",y,x,$1;fflush();for (a=0;a<400000;a++){}}'

@climagic Please don't loose your time with `cat`, it's addictive!

Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!