r.f.e.

2016-03-03 Thread Jude DaShiell
This would have been cleaner had bash been able to wait until a command it 
was given had finished execution before doing its next command:

#!/usr/bin/env bash
# file: sonar.sh - download and test sonar gnome net and mate script
echo 
"https://sourceforge.net/projects/sonargnulinux/files/sonar-mate-edition-2016.03-x86_64.iso/download";
 >sonar.dat
echo 
"https://sourceforge.net/projects/sonargnulinux/files/sonar-gnome-edition-2016.03-x86_64.iso/download";
 >>sonar.dat
echo 
"https://sourceforge.net/projects/sonargnulinux/files/sonar-mate-edition-2016.03-x86_64.iso.sha512/download";
 >>sonar.dat
echo 
"https://sourceforge.net/projects/sonargnulinux/files/sonar-gnome-edition-2016.03-x86_64.iso.sha512/download";
 >>sonar.dat
wget --background --continue --trust-server-names --max-redirect=1 --tries=0 
--input-file="sonar.dat"
echo "#!/usr/bin/env bash" >sonar2.sh
echo "sha512sum -c sonar-gnome-edition-2016.03-x86_64.iso.sha512" 
>>sonar2.sh
echo "sha512sum -c sonar-mate-edition-2016.03-x86_64.iso.sha512" 
>>sonar2.sh
echo "rm -f sonar.dat" >>sonar2.sh
chmod 755 sonar2.sh
echo "run sonar2.sh to test downloaded isos."

--




Re: r.f.e.

2016-03-03 Thread Charles Daffern
On 03/03/16 23:00, Jude DaShiell wrote:
> This would have been cleaner had bash been able to wait until a
> command it was given had finished execution before doing its next
> command:
Bash does that. However, you are passing wget the "--background" option,
which explicitly works around this behaviour.
> wget --background --continue --trust-server-names --max-redirect=1
> --tries=0 --input-file="sonar.dat"
If you remove "--background" from that line, you will get the expected
behaviour.

On another note, you can pass the list of downloads without a temporary
file:

{
  echo http://example.com
  echo http://test.com
} | wget --input-file=-




signature.asc
Description: OpenPGP digital signature


Re: r.f.e.

2016-03-03 Thread Ángel González
> On another note, you can pass the list of downloads without a
> temporary
> file:
> 
> {
>   echo http://example.com
>   echo http://test.com
> } | wget --input-file=-
> 

Or, written even more cleanly:

cat