bash undocumented syntax error

Linux for blind general discussion blinux-list at redhat.com
Sun Jan 13 22:13:08 UTC 2019


On Sun, 13 Jan 2019, Linux for blind general discussion wrote:

> file integrity checking when the time is right.
> Here's some code:
>
> #!/usr/bin/env bash
> # file: getslint.sh - download latest slint iso.
> if [ -f wget-log ];
> rm wget-log

It looks like you solved this, but I believe this should be (it's been 
awhile since I've done this):

if [ -f wget-log ]
   then rm wget-log
fi

for a one-liner like this, you could just as easily write:

[ -f wget-log ] && rm wget-log

or

test -f wget-log && rm wget-log

>   wget -bc --tries=inf --max-redirect=10000 --trust-server-names https://sourceforge.net/projects/slint/files/latest/download
>   until [ tail -2 wget-log|grep "saved" ]; do
> sleep 5
> 	 done
> sha256sum -c slint64-14.2.1.1.sha256sum

NOt sure exactly why you're doing this.  It looks like you're putting wget 
in the background, then waiting around until it finishes.  So why 
background it at all?

Cheers,
Geoff.




More information about the Blinux-list mailing list