LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   [Bash] If clause (https://www.linuxquestions.org/questions/programming-9/%5Bbash%5D-if-clause-718161/)

netpumber 04-10-2009 05:41 AM

[Bash] If clause
 
Where is the false?

Code:

#!/bin/bash
echo "Start dumping?"
read ANSW;
if ["$ANSW"='y']; then
echo "yes";
else
echo "exiting...";
exit
fi

It gives me when i run it this :
Quote:

line 4: [r=y]: command not found
exiting...
Something in the if clause...:s

colucix 04-10-2009 05:44 AM

Put the proper spaces in the if statements:
Code:

if [ "$ANSW" = 'y' ]; then

netpumber 04-10-2009 06:06 AM

Omg... was to simple...:) thanks a lot dude:)


All times are GMT -5. The time now is 03:09 AM.