The UNIX and Linux Forums  

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
Gentoo: POV-Ray User-assisted execution of arbitrary iBot Security Advisories (RSS) 0 12-15-2008 11:10 AM
Gentoo: Graphviz User-assisted execution of arbitrary iBot Security Advisories (RSS) 0 11-10-2008 10:10 AM
exit script if user input not four characters ajp7701 Shell Programming and Scripting 2 10-30-2008 05:48 PM
Set User ID on execution mode. videsh77 UNIX for Dummies Questions & Answers 5 03-02-2007 01:51 PM
Question on Set User ID on Execution akrathi UNIX for Dummies Questions & Answers 7 10-07-2005 05:31 PM

 
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 01-29-2009
yoursdavinder yoursdavinder is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 21
User input for execution of script

Hi,

I need to get the user input and execute a particular script based on the input provided.

For E.g. When I execute the script say Test.sh it should prompt "For which country I need to execute the script? (US/India)"

Based on the input as US or India from the user the execution of the steps in the script need to be done.

I have put some sample code can anyone please help me correct it and get the execution done successfully? How can I accept the user input ??

Code:

$ECHO $n "Enter the Country for which you want the installation to be executed? (US/India). $C"
if [ "${COUNTRY_SPEC}" = "US" -o "${COUNTRY_SPEC}" = "us"]
then
COUNTRY=US
else
COUNTRY=India
fi
echo -e "The installation is for $COUNTRY"
 

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 04:58 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