I copied the below code from some random source to my terminal and ran:
while sleep 1; do tput sc; tput cup 0 $(($(tput cols)-29)); date; tput rc; done &
The code is to show a running clock at the top right corner of the terminal. The snippet worked very well and exactly did what I wanted it to, but now I just want to end this loop and get rid of the clock.
Also, I need to understand the above code. I've some idea, as I know what
tput command does, but still there're many dots which I'm not able to connect.