LinuxAnswers - the LQ Linux tutorial section.
Go Back > Blogs
User Name


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.

"Wait until a process ends, a download ends, or a file conversion ends, then do X"

Posted 08-30-2011 at 04:06 PM by the dsc (linux-related notes)
Updated 08-30-2011 at 10:41 PM by the dsc (a small improvement)

Sometimes you want the computer to shut down after you've finished downloading something or converting some large file into some other format, but you want to go out or go to sleep instead of waiting and checking for it yourself.

For these situations I've come up with two tiny scripts. The first one waits until a file hasn't changed its size on three consecutive intervals of twenty seconds:

a=0 ; file="$1" ; if [ -f "$file.part" ] ; then file="$file.part"
Posted in Uncategorized
Views 917 Comments 0 the dsc is offline


All times are GMT -5. The time now is 04:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration