1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 08:09:03 -08:00
rc/sh/wipe

20 lines
508 B
Bash

#!/usr/bin/env sh
# YES_ZSH
# YES_BASH
# YES_DASH
wipe() {
# TODO: rename because wipe(1) already exists.
[ $# -le 0 ] || { printf "%s\n" "$0: too many arguments" >&2; return 1; }
clear
clear # twice because mintty is weird
echo $'\033[30m\033[107m' | tr -d '$'
if [ -n "${ZSH_VERSION:-}" ]; then
printf '*%.0s' {1..$COLUMNS}
else
tput cols | awk '{for(i=0;i<$0;i++)printf "*"}'
fi
echo $'\033[0m\n' | tr -d '$'
}
[ "${SOURCING:-0}" -gt 0 ] || wipe "$@"