Imported from ../bash-2.0.tar.gz.

This commit is contained in:
Jari Aalto 1996-12-23 17:02:34 +00:00
commit ccc6cda312
502 changed files with 91988 additions and 69123 deletions

25
examples/scripts/scrollbar Executable file
View file

@ -0,0 +1,25 @@
#!/bin/bash
#
# scrollbar - display scrolling text
#
# usage: scrollbar args
#
# A cute hack originally from Heiner Steven <hs@bintec.de>
#
# converted from ksh syntax to bash v2 syntax by Chet Ramey
WIDTH=${COLUMNS:-80}
[ $# -lt 1 ] && set -- TESTING
# Posix.2 compatible printf command or bash loadable builtin
# in examples/loadables/printf
Text=$(printf "%-${WIDTH}s" "$*")
Text=$(echo "$Text" | tr ' ' '_')
while :
do
printf "%-.${WIDTH}s\r" "$Text"
LastC=$(expr "$Text" : '.*\(.\)$')
Text=$(printf "%-.${WIDTH}s" "$LastC$Text")
done