On 10/20/2010 04:34 AM, Kamenik, Aleksander wrote: > Hi, > > I periodically download a file with "wget -N someurl". I want to execute some > external program to process the downloaded file, but only when wget actually > downloaded a new version of it. > > I'm using time stamping and wget always exits with zero if it could contact > the server. So I can't use "wget -N someurl && somescript.sh", this would > always execute the program. > > Currently I use the -nv switch and then count lines of stderr+stdout and if > it's 1, then execute the script. > > Is there a better way, something like find's --exec? > > Wget version 1.11.4 on linux
If you obtain the more recent release, 1.12, better handling of exit codes should allow you to use the && somescript.sh syntax, I think. Hope that helps, -mjc