LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-10-2009, 05:41 AM   #1
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Arch Linux
Posts: 333

Rep: Reputation: 31
[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
 
Old 04-10-2009, 05:44 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,488

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
Put the proper spaces in the if statements:
Code:
if [ "$ANSW" = 'y' ]; then
 
Old 04-10-2009, 06:06 AM   #3
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Arch Linux
Posts: 333

Original Poster
Rep: Reputation: 31
Omg... was to simple... thanks a lot dude
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unknown column 'CrDate' in 'where clause' yawe_frek Linux - Software 1 08-07-2008 08:02 AM
LXer: The Viral Clause LXer Syndicated Linux News 0 07-08-2007 07:46 PM
LXer: A Novellization clause for the next GPL LXer Syndicated Linux News 0 11-24-2006 05:03 AM
How to initialize this structure only in one clause? Xiangbuilder Programming 8 08-27-2003 08:50 AM
MySQL: Subquery in HAVING clause ugenn Programming 2 08-11-2002 11:49 AM


All times are GMT -5. The time now is 10:43 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration