# Basic Error

**URL:** <https://community.unix.com/t/basic-error/164852>\
**Category:** Shell Programming and Scripting\
**Created:** [September 5, 2006, 6:14am UTC](https://community.unix.com/t/basic-error/164852 "2006-09-05T06:14:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkrishnag](https://community.unix.com/letter_avatar/gkrishnag/32/5_5575768a8748004e209b776fc1b2916d.png) [@gkrishnag](https://community.unix.com/u/gkrishnag)\
**Post date:** [September 5, 2006, 6:14am UTC](https://community.unix.com/t/basic-error/164852/1 "2006-09-05T06:14:04Z")

</div>

#!/bin/sh  
read a  
if ["$a" = apple] ; then  
echo "ur good";  
else  
echo "ur bad"  
exit  
fi

I am getting the following error!

/home/xyz/scripts \>help.sh  
apple  
help.sh[3]: [apple: not found.  
ur bad

can i know what would be the wrong in my script

---

<div class="post-metadata">

**Author:** ![tayyabq8](https://community.unix.com/user_avatar/community.unix.com/tayyabq8/32/483_2.png) [@tayyabq8](https://community.unix.com/u/tayyabq8)\
**Post date:** [September 5, 2006, 6:26am UTC](https://community.unix.com/t/basic-error/164852/2 "2006-09-05T06:26:11Z")

</div>

> [@](#):
>
> #!/bin/sh  
> read a  
> if ["$a" = apple] ; then  
> echo "ur good";  
> else  
> echo "ur bad"  
> exit  
> fi

Put space between [ and "$a" it should be like this:

```plaintext
if ["$a" = apple] ; then

```

---

<div class="post-metadata">

**Author:** ![gkrishnag](https://community.unix.com/letter_avatar/gkrishnag/32/5_5575768a8748004e209b776fc1b2916d.png) [@gkrishnag](https://community.unix.com/u/gkrishnag)\
**Post date:** [September 5, 2006, 6:29am UTC](https://community.unix.com/t/basic-error/164852/3 "2006-09-05T06:29:02Z")

</div>

That works..

---

<div class="post-metadata">

**Author:** ![Balkrishna](https://community.unix.com/letter_avatar/balkrishna/32/5_5575768a8748004e209b776fc1b2916d.png) [@Balkrishna](https://community.unix.com/u/Balkrishna)\
**Post date:** [September 5, 2006, 7:10am UTC](https://community.unix.com/t/basic-error/164852/4 "2006-09-05T07:10:11Z")

</div>

Try this

read a  
if [$a = apple]  
then  
echo "ur good"  
else  
echo "ur bad"  
fi
