I am using this code to download and unzip data in bash script file
for dump in $dumps; do
echo "Downloading $dump into $download_folder"
wget -c -P "$download_folder" "$geonames_general_data_repo/$dump"
if [ ${dump: -4} == ".zip" ]; then
echo "Unzipping $dump into $data_dir"
unzip "$download_folder/$dump" -d $data_dir
else
if [ ${dump: -4} == ".txt" ]; then
mv "$download_folder/$dump" $data_dir
fi
fi
done
but I got this error :
importer.sh: Bad substitution
for this line : if [ ${dump: -4} == ".zip" ]
I am using Ubunto 18.04 with latest updates