Sponsored Content
Top Forums Shell Programming and Scripting Two shell variables using nawk Post 302622251 by thibodc on Wednesday 11th of April 2012 09:35:05 PM
Old 04-11-2012
Will this code work for strings? Like if $vechicle1=car make and $vechicle2=bicycle helmet
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

nawk and variables

Hi guy's Im trying to pass variables into nawk and then match them on a value within a record but it don't seem to be working. If i put in the dates i want to see then it works fine.. #!/usr/bin/ksh -x YEST=$(/usr/local/bin/perl -e... (8 Replies)
Discussion started by: plimpix
8 Replies

2. Shell Programming and Scripting

Assigning nawk output to variables

I do a lot of command line scripting to capture data from files or other command output. I've checked in a number of Unix and scripting books but for the life of me I can't find out how to asign field data from nawk output into variables that I can manipulate later. For example, reading a two... (6 Replies)
Discussion started by: steveje0711
6 Replies

3. Shell Programming and Scripting

nawk - Passing variables

Hi, I am passing the varibale using nawk -v to search the pattern from the file. But this variable is not accepting. I couldn't get the crrect output. Help me regarding..... nawk -v PGMNAME="$prog" ' { $0 ~ /PGMNAME/ { .................. ................. ... (3 Replies)
Discussion started by: sharif
3 Replies

4. Shell Programming and Scripting

I can't seem to pass variables properly into a nawk statement

Ok, So up front I'm going to say that I'm a very elementary scripter, and I tend to use tools I don't fully understand, but I shotgun at something until I can get it to work...that said, I can't for the life of me understand why I can't get this to go down the way I want it to. The goal: -to... (6 Replies)
Discussion started by: DeCoTwc
6 Replies

5. Shell Programming and Scripting

how to access values of awk/nawk variables outside the awk/nawk block?

i'm new to shell scripting and have a problem please help me in the script i have a nawk block which has a variable count nawk{ . . . count=count+1 print count } now i want to access the value of the count variable outside the awk block,like.. s=`expr count / m` (m is... (5 Replies)
Discussion started by: saniya
5 Replies

6. Shell Programming and Scripting

Passing the nawk variables to the shell

nawk '($1 ~ "1000") && ($1 ~ "5665" ) { sub ($6,"89");flag =1;print }' old.txt >> new.txt I want to set a flag in awk , if the both conditions are met. I want to pass this flag to shell Can anyone please help me on this (1 Reply)
Discussion started by: prav076
1 Replies

7. Shell Programming and Scripting

nawk - Unable to use 2 variables for NR range

Hi, I need to break an input file into multiple output files. The number of output files is decided by a maximum record count allowed for each file. Hence I am using the nawk command to recursively retrieve a range of lines from an input file and write them to output files. But I am unable to... (3 Replies)
Discussion started by: ragz_82
3 Replies

8. Shell Programming and Scripting

Can I use nawk -v with two or more variables?

Hi, Is it possible in awk/nawk to pass two or more variables in the -v flag? That is: X=1 Y=2 nawk -v X=$X Y=$Y..... Thanks in advance. (7 Replies)
Discussion started by: daytripper1021
7 Replies

9. Shell Programming and Scripting

nawk variables

Hi - The following nawk is not working and trying to understand why! nawk -v t="internal_order" '/SAP_RM_ADMIN_SCHEMA/ && ("" toupper(t)) || /SAP_RM_ADMIN_SCHEMA/ && ("" tolower(t))' PBFD100.ksh My intention is to retrieve the line containing SAP_RM_ADMIN_SCHEMA.internal_order but its just not... (6 Replies)
Discussion started by: anduzzi
6 Replies

10. Shell Programming and Scripting

Multiple bash variables passed into nawk

I have a file that has 2 fields called b_file: 11977 DAR.V3.20150209.1.CSV 3295 DAR.V3.20150209.1.CSV 1721 DAR.V2.20150210.1.CSV I need to search a sftplog using the field 1, but want to maintain the relationship between field 1 and 2. I am passing field 1 as a parameter in a bash loop. ... (14 Replies)
Discussion started by: smenago
14 Replies
Gnome2::GConf::Value(3pm)				User Contributed Perl Documentation				 Gnome2::GConf::Value(3pm)

NAME
Gnome2::GConf::Value - Opaque datatype for generic values SYNOPSIS
$client = Gnome2::GConf::Client->get_default; $client->set($config_key, { type => 'string', value => 'Hello, World', }); print "The Meaning of Life." if ($client->get($another_key)->{value} == 42); DESCRIPTION
"GConfValue" is a dynamic type similar to "GValue", and represents a value that can be obtained from or stored in the configuration database; it contains the value bound to a key, and its type. In perl, it's an hashref containing these keys: type The type of the data. Fundamental types are 'string', 'int', 'float' and 'bool'. Lists are handled by passing an arrayref as the payload of the "value" key: $client->set($key, { type => 'string', value => 'some string' }); $client->set($key, { type => 'float', value => 0.5 }); $client->set($key, { type => 'bool', value => FALSE }); $client->set($key, { type => 'int', value => [0..15] }); Pairs are handled by using the special type 'pair', and passing, in place of the "value" key, the "car" and the "cdr" keys, each containing an hashref representing a GConfValue: $client->set($key, { type => 'pair', car => { type => 'string', value => 'some string' }, cdr => { type => 'int', value => 42 }, }); This is needed since pairs might have different types; lists, instead, are of the same type. value The payload, containing the value of type "type". It is used only for fundamental types (scalars or lists). car, cdr Special keys, that must be used only when working with the 'pair' type. SEE ALSO
Gnome2::GConf(3pm), Gnome2::GConf::Entry(3pm), Gnome2::GConf::Schema(3pm), Gnome2::GConf::ChangeSet(3pm). METHODS
integer = $value_a->compare ($value_b) o $value_b (value) Since: gconf 2.13 string = $value->to_string SEE ALSO
Gnome2::GConf COPYRIGHT
Copyright (C) 2003-2006 by the gtk2-perl team. This software is licensed under the LGPL. See Gnome2::GConf for a full notice. perl v5.14.2 2011-11-17 Gnome2::GConf::Value(3pm)
All times are GMT -4. The time now is 06:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy