[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] Killing subshells
From: |
Paul Wagner |
Subject: |
[Help-bash] Killing subshells |
Date: |
Tue, 30 Oct 2018 14:37:01 +0100 |
User-agent: |
Posteo Webmail |
Dear bashers,
I am trying to create a simple script to schedule wget to grab radio
programmes. Since I occasionally lose the connection, I ended up with
something like
function job() {
i=0
while true
do
i=$((i+1))
wget -a "$name.log" -O "$name-$i.mp3" "$url"
done &
sleep $length
kill %
}
while true
do
t=$(date '+%M %H')
while read startmin starthour length url name
do
[[ $t == $startmin' '$starthour ]] && job &
done < conf-file
sleep 60
done
Unfortunately, the kill does not end wget. What am I missing?
Kind regards,
Paul
- [Help-bash] Killing subshells,
Paul Wagner <=