script that will automatically extract

how do i write a script that will automatically extract rar files after the download in a particular folder?

can you give me an idea please? :smiley: or is there an existing script for this?

My suggestion is:

1.- Monitor the download process,
2.- If is not present, I supose it has finished
3.- Then I try to unrar the file

1.-

while [ 1 ] ; do
  ps | grep "download_process" || break
  sleep 60
done

2 exists only as a condition
3 depend on your tools, maybe something like gunzip downloadedFile.gz, but rar is not familiar to me on unix systems

Is it enough?

cd /source_rar && wget http://......file.rar && cd /target && unrar -e /source_rar/file.rar

It's means:
if successful execute the next command

what does

sleep 60

mean?

i'd also like to extract file such as 7z and zip.

say, if zip, rar and 7z exist, then eztract to mkdir %d or something..can you help me with this please.