Wrong answer for Lab: Conditional Logic

For condition logic answer are incorrect
if [ -d “/home/bob/caleston” ]
then
echo “Directory exists”
else
echo “Directory not found”
Screen Shot 2021-03-04 at 11.34.04 AM

I copied answer and ran it.

same for fallowing question syntax error:

if [ $1 -gt $2 ]
then
echo $1
else
echo $2
Screen Shot 2021-03-04 at 11.36.03 AM

Hello, @volodymyr
I think you forgot to close if condition with fi .
Simple pattern:

if
<statement>
else
<statement>
fi

thank you for the answer @player001. that’s my thought too but i wanted to bring attention to platform administrators that they provided wrong answer in the file. confusing at first. As you see i’m doing cat on the provided answer and using that script as it is in the file to run.

So did you copy that answer file in the current location? Because you’re doing cat to /tmp/assets/ directory.

i copied exact content copy past into the file made it executable and ran it.

Let me test it… :+1:

I copied exact answer file and it’s working.

Oh is see my mistake. thank you.

Okay, please try again. :+1:

Try as below

if [ -d “/home/bob/caleston” ]
then
echo “Directory exists”
else
echo “Directory not found”
fi