Sponsored Content
Top Forums Shell Programming and Scripting Passing Command Line Args in a Single Variable? Post 302685845 by Corona688 on Monday 13th of August 2012 12:05:27 PM
Old 08-13-2012
You cannot nest quotes inside quotes, and still expect them to work. Quotes do not work that way. Any methods you can kludge them into working with are, by definition, severe security holes, because if the shell is re-evaluating quotes, it will also re-evaluate backticks and the like. Someone could feed `rm -Rf ~/` into your program and it would do it.

Usually, if you're trying to do that, there's better ways to solve the problem which have been overlooked. But to know how to solve your problem, first we need to know what it is, and we don't.

We know how you're trying to solve it -- put a whole command in a variable -- but have no idea why you're trying to put a whole command in a variable. Usually, there's zero need to do so.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing the command line argument in a variable

Hi, I am new to unix. Is their a way to pass the output of the line below to a variable var1. ls -1t | head -1. I am trying something like var1=ls -1t | head -1, but I get error. Situation is: I get file everyday through FTP in my unix box. I have to write a script that picks up first... (1 Reply)
Discussion started by: rkumar28
1 Replies

2. UNIX for Dummies Questions & Answers

required command line args

Hello, How do I make a command line argument required using getopts? Thanks. (6 Replies)
Discussion started by: yoi2hot4ya
6 Replies

3. Programming

Command line args

My program usage takes the form for example; $ theApp 2 "one or more words" i.e. 3 command line arguments; application name, an integer, some text My code includes the following 4 lines: int anInteger; char words; sscanf(argv, "%d", &anInteger); sscanf(argv, "%s", &message); Based... (2 Replies)
Discussion started by: enuenu
2 Replies

4. UNIX for Dummies Questions & Answers

command line args

I am trying to print command line arguments one per second. I have this while do echo "6" shift echo "5" shift echo "4" shift echo "3" shift echo "2" shift echo "1" shift done (2 Replies)
Discussion started by: skooly5
2 Replies

5. UNIX for Dummies Questions & Answers

command line args 2

I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence and it printed the value of $1 after every number. I don't want that I just want... (2 Replies)
Discussion started by: skooly5
2 Replies

6. Shell Programming and Scripting

How to retrieve command line args one by on.

Hi, I have to store all the command line arguments into an array. I have the following code. ********************** #! /bin/sh set -A arr_no_updates i=1 while do arr_no_updates=$($i) echo ${arr_no_updates} i=$(($i+1)) done**************** (1 Reply)
Discussion started by: little_wonder
1 Replies

7. Shell Programming and Scripting

command line args in unix

Hi, i have a perl script named test.pl. It is executed as cat *.log|test.pl i need the complete command line args. I tried using basename $0 but im getting test.pl only but not cat *.log... Can anyone help me on this. Thanks in advance (3 Replies)
Discussion started by: niteesh_!7
3 Replies

8. Emergency UNIX and Linux Support

Cut | command line args

Hi, Can you please hint me how to achieve the below? Input: $./script.sh start 1 2 Internally inside the script i want to set a single variable with $2 and $3 value? Output: CMD=$1 ARGS=$2 $3 --VInodh (10 Replies)
Discussion started by: vino_hymi
10 Replies

9. Shell Programming and Scripting

Reading of variable in a single line command

Hi All, Below is a sample command that I can run without any problem in the command line. Command Line dtToday=`date +%Y%m%d`; ls -ltr ./filename_${dtToday}.txt -rw-r--r-- 1 monuser oinstall 0 Jan 18 11:02 ./filename_20130118.txt But once I put that command line in file (list.txt) and... (3 Replies)
Discussion started by: padi
3 Replies

10. Shell Programming and Scripting

Passing the value of variable which is read from command line in called script

Hi, I am calling a Perl script in my shell script. When Perl script is executed it asks for a answer to be entered by user from terminal. How can i pass that value from my shell script ?? I know I can change perl script to default the answer but i dont have access to do that so only option i... (5 Replies)
Discussion started by: varun22486
5 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:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy