1 #!/bin/sh 2 # Display text from the current line upward (instead of downward) 3 input="$(cat)" 4 printf "\\033[$(echo "$input" | wc -l)A\\033[J" >/dev/tty 5 echo "$input"