Build a Build Script: 9/13

Just after keying “1” i get the following error -

“./script.sh: line23: syntax error near unexpected token ‘else’
./script.sh: line 23 'else”

#!/bin/bash
#Banner Message
echo “Let’s get building!!!”

#Version
firstline=$(head -n 1 source/changelog.md)
read -a splitfirstline <<< $firstline

version=${splitfirstline[1]}
echo “You are building version” $version

echo ‘Do you want to continue? (enter “1” for Yes, “0” for No)’
read versioncontinue

#Condition to Version Continue
if [ $versioncontinue -eq 1 ]
then
echo “OK”
for filename in source/*
do echo $filename
if ["$filename" == “source/secretinfo.md”] then
echo “Not copying” $filename
else
echo “Copying” $filename
fi
done
else
echo “Please come back when you are ready”
fi

Any help or advice is appreciated

Hello @bboycpu.

Welcome to the forum!

In the line above, then needs to be on the next line like you have it here:

Happy coding!

1 Like

Thanks! Thank you so much. I’ve been working on that problem for days. Thanks :blush::pray:t3::blush:

1 Like

You are very welcome!

This topic was automatically closed after 23 hours. New replies are no longer allowed.