Sponsored Content
Full Discussion: Variables within awk
Special Forums UNIX Desktop Questions & Answers Variables within awk Post 302545025 by Cablephish on Friday 5th of August 2011 10:45:06 PM
Old 08-05-2011
Your last method at the very bottom proved to be useful. Thank you very much for your help Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk with variables

Hi I have a file with a line like this, wich is read by an awk script : Logical Name | Server Type | Server1 | DB1 | User1 | $PASSWORD | Serv2 |DB2 | User2 | $PASSWORD Awk reads it fine, but...it doesnt interpret the variable $PASSWORD as I wish. How do I tell awk to substitute $PASSWORD... (3 Replies)
Discussion started by: Scarlos
3 Replies

2. Shell Programming and Scripting

OLD value for awk variables

I want to print old and new values of some field in Awk script. This is wat I done! Sample file is as follows But the output I god is bit different What must be the problem here? I am using bash. (2 Replies)
Discussion started by: yogesh_powar
2 Replies

3. Shell Programming and Scripting

Awk and Variables

Hi, I have some files in metrica (assume a pre-defined format) which i need to process and have some values in a .csv file. The script that does this, part of which is: procMetricaOMData() { host=$1 fileIN=$2 fileOUT=$3 $CATCMD $fileIN | \ awk -f... (4 Replies)
Discussion started by: deepak4you
4 Replies

4. Shell Programming and Scripting

awk variables

hi i am using the following awk code for some calculations: awk '/,1,/' "$LINE" >> "$count".dat awk '/,1,/ { i++ } END { print i }' "$count".dat awk '{sum+=$3} END {print sum}' 1.spd > test awk '{average=sum/i} END {print average}' 1.spd >> test can i use a variable created in one... (12 Replies)
Discussion started by: npatwardhan
12 Replies

5. UNIX for Dummies Questions & Answers

Using variables in AWK

Hi, I'm pretty new to AWK and was wondering if someone could let me know how to execute varibles within an AWK statement. An example is below: NO=6 end=25 awk = 'NR == $NO, NR == $end' file1 > file2 I'm currently attempting to use this within a script but awk seems to read $NO and... (2 Replies)
Discussion started by: chris01010
2 Replies

6. Shell Programming and Scripting

Using AWK variables.

Hi all, I am new to the forum and Shell Script programming. The problem is: I need to do a script to search all system processes and show me hierarchical way the number of bytes occupied by each of the regions of the memory map of each process. Today I got to show me the number of regions in... (3 Replies)
Discussion started by: cougar_rea
3 Replies

7. Shell Programming and Scripting

ksh passing to awk multiple dyanamic variables awk -v

Using ksh to call a function which has awk script embedded. It parses a long two element list file, filled with text numbers (I want column 2, beginning no sooner than line 45, that's the only known thing) . It's unknown where to start or end the data collection, dynamic variables will be used. ... (1 Reply)
Discussion started by: highnthemnts
1 Replies

8. Shell Programming and Scripting

AWK - variables

I have a data file like this: 49960 1157 32390 1227 1268 31 8 21 12 115 18493 67 250 2 2 237704 369658 52 21 312 38 27746 3174 19 160 9 555 6337 6071 43 33 I want to separate the field to three groups, $1 and $2 are the first group, $3 and $4 are the second group, $5 and $6... (1 Reply)
Discussion started by: xshang
1 Replies

9. Shell Programming and Scripting

awk - Why can't value of awk variables be passed to external functions ?

I wrote a very simple script to understand how to call user-defined functions from within awk after reading this post. function my_func_local { echo "In func $1" } export -f my_func_local echo $1 | awk -F"/" '{for (k=1;k<=NF;k++) { if ($k == "a" ) { system("my_local_func $k") } else{... (19 Replies)
Discussion started by: sreyan32
19 Replies

10. Shell Programming and Scripting

Passing awk variables to bash variables

Trying to do so echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies
DialogBox(3)						User Contributed Perl Documentation					      DialogBox(3)

NAME
Tk::DialogBox - create and manipulate a dialog screen. SYNOPSIS
use Tk::DialogBox ... $d = $top->DialogBox(-title => "Title", -buttons => ["OK", "Cancel"]); $w = $d->add(Widget, args)->pack; ... $button = $d->Show; DESCRIPTION
DialogBox is very similar to Dialog except that it allows any widget in the top Frame. DialogBox creates two Frames, top and bottom. The bottom Frame shows all the specified Buttons, lined up from left to right. The top Frame acts as a container for all other widgets that can be added with the add() method. OPTIONS
The options recognized by DialogBox are as follows: -title Specify the title of the DialogBox. If this is not set, then the name of the program is used. -buttons The button names to display in the bottom Frame. This is a reference to an array of strings containing the text to put on each Button. There is no default value for this. If you do not specify any button names, no Buttons are displayed. -default_button Specifies the default Button that is considered invoked when user presses <Return> on the DialogBox. This Button is highlighted. If no default Button is specified, then the first element of the array whose reference is passed to the -buttons option is used as the default. -cancel_button Specifies the Button that is considered invoked when the user closes the DialogBox using the window manager's close button. If the -cancel_button option is not given, and if there's only one button configured, then this button is also used as the cancel button. Otherwise no button is considered as the cancel button; in such a case Show just returns "undef" when the user closes the DialogBox. -command A callback which is executed after invoking an action to close the DialogBox, but before restoring focus and grab information. The selected button is passed as the first argument. -focus Specify the widget to receive the initial focus after popping up the DialogBox. By default the -default_button widget receives the initial focus. -showcommand A callback which is executed before displaying the DialogBox and waiting for user input. The DialogBox itself is passed as the first argument. METHODS
DialogBox supports only two methods as of now: add(widget, options) Add the widget indicated by widget. Widget can be the name of any Tk widget (standard or contributed). options are the options that the widget accepts. The widget is advertized as a subwidget of DialogBox. The name of widget is lower-cased and used as the advertised name. If multiple instances of widget are created in the DialogBox, then only the last one gets the advertised name. add() does not automatically pack() or grid() widget into the DialogBox. Show(?-global?) Displays the Dialog until the user invokes one of the Buttons in the bottom Frame. If the grab type -global is specified, then Show uses that grab; otherwise it defaults to a local grab. Returns the name of the Button invoked. The actual Dialog is shown using the Popup method. Any other options supplied to Show are passed to Popup, and can be used to position the Dialog on the screen. Please read Tk::Popup for details. Exit() Close the dialogbox, by emulating a click on the default button. ADVERTISED WIDGETS
top The subwidget reference to the top half of the DialogBox widget, the Frame containing widgets added by the add method. bottom The subwidget reference to the bottom half of the DialogBox widget, the Frame containing the Button widgets. B_"button-text" Individual subwidget references to the Buttons in the DialogBox widget. The subwidget name is the string B_ concatenated with the Button's -text value. BUGS
There is no way of removing a widget once it has been added to the top Frame, unless you access the top subwidget and go through the child widgets. There is no control over the appearance of the Buttons in the bottom Frame nor is there any way to control the placement of the two Frames with respect to each other. AUTHOR
Rajappa Iyer rsi@earthling.net This code is distributed under the same terms as Perl. perl v5.12.1 2007-07-10 DialogBox(3)
All times are GMT -4. The time now is 02:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy