UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 2nd, 2011, 05:12 AM
thelakbe thelakbe is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Posts: 6 thelakbe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 19 sec
Reputation Power: 0
Then' is not matched

Hi all,

I'm writing the script which displays the below error while executing it i unable to trace it
[Error]:Syntax error at line 32 : `then' is not matched[/error]
Code:
#!/bin/sh
clear

 while :
  do
   tput cup 7 1  ; echo "Name of the EDP operator: ______________ (Q-Quit)\c"
    tput cup 7 27 ; read aeUserId

     case "$aeUserId" in
      "Q"|"q")        return
                       ;;
                        "")             continue
                         ;;
         esac
 ##
 ## Check for valid UNIX user
 ##
  if ! grep "$aeUserId:" /etc/passwd > /dev/null ; then
  tput cup 9 1 ; echo "ERROR: User Id specified does not exist..."
   Pause
             continue
                      fi
                       break
                        done
 echo PLEASE ENTER THE ENVIRONMENT ITMM or ASIA
read env
env="$echo "$env" | tr "[:lower:]" "[:upper:]")"
if [ "$env" = "ITMM" ] ; then
echo $PLEASE ENTER THE FUNCTIONAL PREFIX with '*'
read tk
find /apps/pahalnger2/storage/data -name "$tk" -exec ls -lrt {} \;
elif [ "$env" = "ASIA" ] ; then
echo $PLEASE ENTER THE FUNCTIONAL PREFIX with '*'
read kt
find /apps/pahalnger3/storage/data -name "$kt" -exec ls -lrt {} \;


thanks for the timely help

Reply With Quote
  #2  
Old December 2nd, 2011, 07:36 AM
SimonJM SimonJM is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2006
Posts: 2,108 SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 48 m 25 sec
Reputation Power: 1485
Apart from 'nasty' indentation, using Pause instead of pause (unless you have a command called Pause) you do not have a fi to match the last if.
__________________
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc

Reply With Quote
  #3  
Old December 2nd, 2011, 08:04 AM
thelakbe thelakbe is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Posts: 6 thelakbe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 5 m 19 sec
Reputation Power: 0
Quote:
Originally Posted by SimonJM
Apart from 'nasty' indentation, using Pause instead of pause (unless you have a command called Pause) you do not have a fi to match the last if.


thanks simon it's my nasty mistake thanks for the suggestion
now it's working

Reply With Quote
  #4  
Old December 2nd, 2011, 04:12 PM
SimonJM SimonJM is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2006
Posts: 2,108 SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level)SimonJM User rank is General 8th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 4 h 48 m 25 sec
Reputation Power: 1485
Glad it's working.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Then' is not matched

Developer Shed Advertisers and Affiliates



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap