The UNIX and Linux Forums  
Hello and Welcome from to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
If statement - How to write a null statement april Shell Programming and Scripting 3 04-16-2008 02:14 PM
korn shell to bash - statement not working brdholman UNIX for Dummies Questions & Answers 5 10-15-2007 10:49 AM
if statement in ksh gfhgfnhhn UNIX for Dummies Questions & Answers 3 10-20-2006 10:37 AM
if and sed statement chris1234 Shell Programming and Scripting 3 04-26-2006 12:06 AM
find/if statement not working geomonap Shell Programming and Scripting 12 12-16-2005 09:56 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-12-2007
Hazmeister Hazmeister is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 3
If statement not working

I understand this question probably poses some child like stupidity, but I can't get this if statement to work for love or money.

#!/bin/ksh
echo "Input either 1 or 2"
read Num
if [$Num -eq 1 ]; then
echo "Message 1"
if [$Num -eq 2 ]; then
echo "Message 2"
else
echo "false"
fi

$ ksh decisions
Input either 1 or 2
2
decisions[4]: syntax error at line 4 : `then' unmatched
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0