I need my script to show the time till next run, continuously like a timer, is this possible? 
Is there any way to make scripts dynamic?
bash;shell;shell script
You could do a lot of the work w/ shell math so you don't have to fork every few seconds, but you probably would want to work in some sort of synchronizer every once in a while to ensure the time is keeping well.The below loop just sets some initial values for $h, $m, and $s then decrements once every 15 seconds and prints a countdown line at the top-left hand of the terminal screen (row 1, column 1, \033[Home). You can background it without issue, but you'd probably want to safe it with other traps first if it were to run for awhile.(h=23 m=1 s=60; trap '' TTOUuntil [ $(((h-=(!(m-=!(s-=s?15:-45)*(m?1:-59))&&!s))+m+s)) -eq 0 ]do    sleep 15      printf \0337\033[H\033[KT- %02d : %02d : %02d\0338 \             $h $((m?m:60)) $((s?s:60))done) &The line it prints looks like this top one here...T- 22 : 49 : 60 130 mikeserv@localhost ~ %       130 mikeserv@localhost ~ %       130 mikeserv@localhost ~ % (     h=23 m=1 s=60; trap '' TTOUI actually forgot it was still running, but it will continue to draw over the same place if the terminal doesn't scroll, like this...T- 22 : 48 : 30 130 mikeserv@localhost ~ %       130 mikeserv@localhost ~ %       130 mikeserv@localhost ~ % (     h=23 m=1 s=60; trap '' TTOUBut if the terminal does scroll its line will be scrolled off the screen until at most 15 seconds elapse and it prints another. The escapes used are commonly interpreted as sc (savecursor: \0337), hr (home row: \033[H), kl (kill line: \033[K) and rc (restore cursor: \0338). If any of these do not work for you you should check with tput for their values. Basically the cursor position is first saved, then moved to the top of the terminal screen, the top line is erased, and the countdown is printed. The cursor position is restored.It works by balancing the decrements.Like... h - !(m - !(s - s < 60 ? 15 : -45 ) && !s )...there's a little more to it than that, but the method is only to subtract one from a larger value when a smaller value decrements to 0. So when the seconds value decrements from 1 to 0 the minutes value also decrements - and when both minutes and seconds are zero, so also does the hours value decrement.When the loop completes... nothing happens. I don't really know what you want done, but whatever it is, you should tuck it in after the done there. You should be able to start $h $m and $s at pretty much any value, but, as written, the $seconds value is expected to decrement in 15 second intervals (though that is easily altered). Anyway, just keep that in mind.