Sponsored Content
Full Discussion: Storing Command Line Values
Top Forums Shell Programming and Scripting Storing Command Line Values Post 302282085 by yoursdavinder on Friday 30th of January 2009 06:08:22 AM
Old 01-30-2009
Storing Command Line Values

Hi,
I am trying to read the value passed by the user and store it in a variable so that later I can read it from the variable. But I am getting errors. Can you please help? Thanks.

Code:
$ECHO "Enter the Country for which you want the installation to be executed? (US/India):"
read COUNTRY
if [ "$COUNTRY" = "us" -o "$COUNTRY" = "US" ]
then
$COUNTRY="US"
else
$COUNTRY="India"
fi
$echo "The installation is for: $COUNTRY"

Execution Result:
./Country_Test.sh: line 4: Enter the Country for which you want the installation to be executed?: command not found
us
./Country_Test.sh: line 8: us=US: command not found
./Country_Test.sh: line 13: The installation is for: us: command not found
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Storing values in variable

Hi All, Here is the description of the problem. I am scripting for database access using k-shell on solaris box dbaccess <databasename> - << EOF 2>/dev/null | awk 'BEGIN {FS=" "}\ {printf "%s", $1}' | grep -v "^$" | \ read cnt1 OUTPUT TO PIPE cat WITHOUT HEADINGS select count(*) from... (1 Reply)
Discussion started by: matrixmadhan
1 Replies

2. Programming

Need help in storing command line argument argv[2] to a variable of int type

The following program takes two command line arguments. I want the second argument (fileCount) to be stored/printed as a int value. I tried my best to typecast the char to int (check the printf statement at last) but is not working...the output is some junk value. This program is in its... (3 Replies)
Discussion started by: frozensmilz
3 Replies

3. UNIX for Dummies Questions & Answers

Storing Multiple Values in a Variable

Hi, My code is as below: integer i=7 while ((i <= 5 )); do # test_out is a variable which contains data separated by "^". a= `echo $test_out | cut -d"^" -f$i` echo "$a" (( i = i + 1)); done From the above code, i kept $i after f so that i can capture all the data which is... (1 Reply)
Discussion started by: sandeep_1105
1 Replies

4. Shell Programming and Scripting

storing values in a list or array

i have a file called file.txt having the following entries. 2321 2311 2313 4213 i wnat to store these values in a list and i want to iterate the list using loop and store it in another list (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

5. Shell Programming and Scripting

fetching values using awk and storing into array

hi all I am using awk utility to parse the file and fetching two different vaues from two different record of a record set. I am able to see the result, now i want to store the result and perform some check of each values form database to mark valid and invalid. could you please help me... (3 Replies)
Discussion started by: singhald
3 Replies

6. Shell Programming and Scripting

storing values in arrays using shell

Friends, I have to execute a command and store its contents into an array using shell. this is what i have tried #!/bin/bash disk_names = ($(`iostat -xtc | egrep -v "device|nfs" | awk '{print $1}'| tr '\n' ' ' `)) But its throwing an error message as ./test-script ./test-script:... (6 Replies)
Discussion started by: achak01
6 Replies

7. Shell Programming and Scripting

Storing values in arrays using csh

I am reading a number of files but then I want to put the ranges xmin xmax ymin ymax as arrays for each file. Any idea how I can do this??? set j = 1 echo "Welcome $i times" while ( $j <= $i ) echo "$j" set fname = $fin-bst-misf.xy echo " "$fname ... (0 Replies)
Discussion started by: kristinu
0 Replies

8. Shell Programming and Scripting

Storing values in arrays

I have the following csh script which lets the use pass the following as an argument -legend=tag1/tag2/tag3/tag4/tag5/tag6/tag7 We pass a number of tags separated by '/'. I want to save the legend tags in an array and have done as below. How can I improve on this as things are getting quite... (3 Replies)
Discussion started by: kristinu
3 Replies

9. UNIX for Dummies Questions & Answers

Storing values in shell variable

Hi, I am writing a shell script where, x=y y=z When I want to print z, I can do $y How do I use only "x" without any direct reference to "y" to print z? Thanks, -G (3 Replies)
Discussion started by: gaurab
3 Replies

10. Shell Programming and Scripting

storing multiple values in a array variable

Am using a find command in my script .The output may be one or more. I need to store those values in a array and need to access those. Am unable to find the solution . Any help on this will be helpful. if < code> else a=<find command output which gives the file name either 1 or more> if 1... (1 Reply)
Discussion started by: rogerben
1 Replies
ttk::scale(3tk) 						 Tk Themed Widget						   ttk::scale(3tk)

__________________________________________________________________________________________________________________________________________________

NAME
ttk::scale - Create and manipulate a scale widget SYNOPSIS
ttk::scale pathName ?options...? _________________________________________________________________ DESCRIPTION
A ttk::scale widget is typically used to control the numeric value of a linked variable that varies uniformly over some range. A scale dis- plays a slider that can be moved along over a trough, with the relative position of the slider over the trough indicating the value of the variable. STANDARD OPTIONS
-class -cursor -style -takefocus See the ttk_widget manual entry for details on the standard options. WIDGET-SPECIFIC OPTIONS Command-Line Name:-command Database Name: command Database Class: Command Specifies the prefix of a Tcl command to invoke whenever the scale's value is changed via a widget command. The actual command con- sists of this option followed by a space and a real number indicating the new value of the scale. Command-Line Name:-from Database Name: from Database Class: From A real value corresponding to the left or top end of the scale. Command-Line Name:-length Database Name: length Database Class: Length Specifies the desired long dimension of the scale in screen units (i.e. any of the forms acceptable to Tk_GetPixels). For vertical scales this is the scale's height; for horizontal scales it is the scale's width. Command-Line Name:-orient Database Name: orient Database Class: Orient Specifies which orientation whether the widget should be laid out horizontally or vertically. Must be either horizontal or vertical or an abbreviation of one of these. Command-Line Name:-to Database Name: to Database Class: To Specifies a real value corresponding to the right or bottom end of the scale. This value may be either less than or greater than the from option. Command-Line Name:-value Database Name: value Database Class: Value Specifies the current floating-point value of the variable. Command-Line Name:-variable Database Name: variable Database Class: Variable Specifies the name of a global variable to link to the scale. Whenever the value of the variable changes, the scale will update to reflect this value. Whenever the scale is manipulated interactively, the variable will be modified to reflect the scale's new value. WIDGET COMMAND
pathName cget option Returns the current value of the specified option; see ttk::widget(3tk). pathName configure ?option? ?value option value ...? Modify or query widget options; see ttk::widget(3tk). pathName get ?x y? Get the current value of the -value option, or the value corresponding to the coordinates x,y if they are specified. X and y are pixel coordinates relative to the scale widget origin. pathName identify x y Returns the name of the element at position x, y. See ttk::widget(3tk). pathName instate statespec ?script? Test the widget state; see ttk::widget(3tk). pathName set value Set the value of the widget (i.e. the -value option) to value. The value will be clipped to the range given by the -from and -to options. Note that setting the linked variable (i.e. the variable named in the -variable option) does not cause such clipping. pathName state ?stateSpec? Modify or query the widget state; see ttk::widget(3tk). INTERNAL COMMANDS
pathName coords ?value? Get the coordinates corresponding to value, or the coordinates corresponding to the current value of the -value option if value is omitted. SEE ALSO
ttk::widget(3tk), scale(3tk) KEYWORDS
scale, slider, trough, widget Tk 8.5 ttk::scale(3tk)
All times are GMT -4. The time now is 10:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy