I want a similar behavior as less vim nano etc. uses.Is this possible to achieve with bash?
Show output on another screen and return to normal when done
bash;terminal
If your terminal emulator supports it, you can do this using the same mechanism used by less, vim, et al, namely the ti and te termcap capabilities (smcup and rmcup in the more modern terminfo).  These switch from the primary to the secondary screen, and back to the primary, respectively.If your system has the tput command, you can use:tput smcup # switch to secondary screen...tput rmcup # switch back to primary screenOtherwise, for xterm, and probably for most other terminal emulators, this:printf '\e[7\e[?47h'should switch to the secondary screen, and this:printf '\e[2J\e[?47l\e8'should switch back to the primary (and put the cursor back where it was).tcsh has a built-in echotc command, so you could do:tcsh -c 'echotc ti'...tcsh -c 'echotc te'(or just use echotc directly if you happen to be using tcsh).