![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Problem with while loop in shell script | rkrgarlapati | Shell Programming and Scripting | 20 | 02-02-2009 03:13 AM |
| Help shell script to loop through files update ctl file to be sql loaded | dba_nh | Shell Programming and Scripting | 1 | 04-15-2008 09:00 PM |
| Infinite Loop in Autosys while running a shell script, Manual run is fine | sharmagaurav_2k | Shell Programming and Scripting | 2 | 09-04-2007 09:20 AM |
| Shell Script loop problem | MaxMouse | Shell Programming and Scripting | 1 | 07-26-2005 04:19 PM |
| shell script - loop to countdown | froggwife | UNIX for Dummies Questions & Answers | 2 | 11-29-2001 10:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
If then else loop in Shell script
Hi
Following is the code . When I give input as Bangalore,its dospalying Welcome to Hitech City. But say , if I select Delhi or US, its not displaying the corresponding message. Its still says Welcome to Hitech City. Seems that it not entering in the elif part. Please suggest. #! bin/bash echo "Enter the name of City from following :Bangalore,Delh,US" read dist if [ $dist=Bangalore] then echo " Welcome to Hitech City" elif [ $dist=Delhi ] then echo " Welcome to National Capital " elif [ $dist=US ] then tput blink echo " Well you are trying for US !!! " else echo " Please try again from given option only !!!! " fi Thanks Pankaj |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|