Re: bash undocumented syntax error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list



[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]