#!/bin/bash _user_host(){ local username hostname username="${USER:-$(id -un)}" hostname="${HOSTNAME:-$( 0 )); then trap 'printf "\e[?1049l"; stty echo; exit' 2 printf '\e[?1049h' for((;;)){ printf '\e[2J\e[H' main sleep "$1" } else main fi stty echo