Sponsored Content
Full Discussion: selecting the stanza fields
Top Forums Shell Programming and Scripting selecting the stanza fields Post 302192982 by vijaya2006 on Thursday 8th of May 2008 08:00:15 AM
Old 05-08-2008
Tools selecting the stanza fields

Hi Friends,

I have a stanza file as below :

CuDv:
name = "hdisk34"
status = 0
chgstatus = 3
ddins = "scsidisk"
location = "06-08-02"
parent = "fscsi0"
connwhere = "W_0"
PdDvLn = "disk/fcp/mpioosdisk"

CuDv:
name = "hdisk10"
status = 1
chgstatus = 0
ddins = "scsidisk"
location = "06-08-02"
parent = "fscsi0"
connwhere = "W_0"
PdDvLn = "disk/fcp/mpioosdisk"

CuDv:
name = "hdisk11"
status = 0
chgstatus = 0
ddins = "scsidisk"
location = "06-08-02"
parent = "fscsi1"
connwhere = "W_0"
PdDvLn = "disk/fcp/mpioosdisk"

CuDv:
name = "hdisk12"
status = 1
chgstatus = 0
ddins = "scsidisk"
location = "06-08-02"
parent = "fscsi1"
connwhere = "W_0"
PdDvLn = "disk/fcp/mpioosdisk"


I want the name and the parent fields only if the field "status=1"
i.e.,

hdisk10 fscsi0
hdisk12 fscsi1

( It should not show the disks hdisk34 and hdisk11 as their "status not equal to 1" ).

Urgent reply required..

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

getting the stanza names if the pattern found

Hi Friends, I have a file as below : machine1: abc xyz qwerty machine2: jkl mno machine3: hhh kkk qwerty Now ...i need to find all the stanza names that have the pattern "qwerty'" in it...( i need to get the output as machine1 and machine3 since... (4 Replies)
Discussion started by: vijaya2006
4 Replies

2. Shell Programming and Scripting

awk sed cut? to rearrange random number of fields into 3 fields

I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want. The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies

3. Shell Programming and Scripting

selecting specific fields in a file (maybe with sed?)

Hi, I have a file with following lines: chr1 10 AC=2;AF=1.00;AN=2;DP=2;Dels=0.00;HRun=0;HaplotypeScore=0.00;MQ=23.00;MQ0=0;QD=14.33;SB=-10.01 chrX 18 AB=0.52;AC=1;AF=0.50;AN=2;DP=203;DS;Dels=0.00;HRun=0;HaplotypeScore=20.01;MQ=15.63;MQ0=85;QD=12.80;SB=-1289.58 I need to extract 4... (2 Replies)
Discussion started by: menenuh
2 Replies

4. Shell Programming and Scripting

How to print 1st field and last 2 fields together and the rest of the fields after it using awk?

Hi experts, I need to print the first field first then last two fields should come next and then i need to print rest of the fields. Input : a1,abc,jsd,fhf,fkk,b1,b2 a2,acb,dfg,ghj,b3,c4 a3,djf,wdjg,fkg,dff,ggk,d4,d5 Expected output: a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
Discussion started by: 100bees
6 Replies

5. Shell Programming and Scripting

awk - compare 1st 15 fields of record with 20 fields

I'm trying to compare 2 files for differences in a selct number of fields. When differnces are found it will write the whole record of the second file including appending '|C' out to a delta file. Each record will have 20 fields, but only want to do comparison of 1st 15 fields. The 1st field of... (7 Replies)
Discussion started by: sljnk
7 Replies

6. AIX

Fsize in default: stanza.

The default: stanza in /etc/security/limits is still set to 2097151 on fsize (max file size). I know tar had issues with large files but is there any other reasons for it? I'm thinking yes since it's still set to that by IBM. Cheers, DH (4 Replies)
Discussion started by: Devyn
4 Replies

7. Shell Programming and Scripting

awk sort based on difference of fields and print all fields

Hi I have a file as below <field1> <field2> <field3> ... <field_num1> <field_num2> Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields. I tried this and it doesn't sort on the difference field .. Appreciate your help. cat... (9 Replies)
Discussion started by: newstart
9 Replies

8. Shell Programming and Scripting

How to extract entire stanza using awk?

Hello friends, I have a text file with lot of stanzas with each starting with "O-O-O. Sample file :- 1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. e4 Nxc3 6. bxc3 Bg7 7. Nf3 c5 8. Rb1 O-O 9. Be2 cxd4 10. cxd4 Qa5+ 11. Bd2 Qxa2 12. O-O Bg4 13. Bg5 h6 14. Be3 (8 Replies)
Discussion started by: prvnrk
8 Replies

9. Shell Programming and Scripting

A Stanza File Parser in Pure ksh

As it was ultimately Don Craguns idea that saved the whole project i can as well give something back to the community. This is my stanza file parser, which was written only using ksh without any external programs. The stanza structure There is some inconsistency as to what exactly is meant by... (0 Replies)
Discussion started by: bakunin
0 Replies

10. UNIX for Beginners Questions & Answers

Is there a UNIX command that can compare fields of files with differing number of fields?

Hi, Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account. $ head -500 x.txt y.txt ==> x.txt <== TEST01 APP_USER_PROFILE USER03 APP_USER_PROFILE TEST02 APP_USER_EXP_PROFILE TEST04 APP_USER_PROFILE USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
deb-substvars(5)						    dpkg suite							  deb-substvars(5)

NAME
deb-substvars - Debian source substitution variables SYNOPSIS
substvars DESCRIPTION
Before dpkg-source, dpkg-gencontrol and dpkg-genchanges write their control information (to the source control file .dsc for dpkg-source and to standard output for dpkg-gencontrol and dpkg-genchanges) they perform some variable substitutions on the output file. A variable substitution has the form ${variable-name}. Variable names consist of alphanumerics, hyphens and colons and start with an alphanumeric. Variable substitutions are performed repeatedly until none are left; the full text of the field after the substitution is rescanned to look for more substitutions. After all the substitutions have been done each occurrence of the string ${} (which is not a legal substitution) is replaced with a $ sign. While variable substitution is done on all control fields, some of those fields are used and needed during the build when the substitution did not yet occur. That's why you can't use variables in the Package, Source and Architecture fields. Variable substitution happens on the content of the fields after they have been parsed, thus if you want a variable to expand over multiple lines you do not have to include a space after the newline. This is done implicitly when the field is output. For example, if the variable ${Description} is set to "foo is bar.${Newline}foo is great." and if you have the following field: Description: foo application ${Description} . More text. It will result in: Description: foo application foo is bar. foo is great. . More text. Variables can be set using the -V common option. They can be also specified in the file debian/substvars (or whatever other file is specified using the -T option). This file consists of lines of the form name=value. Trailing whitespace on each line, blank lines, and lines starting with a # symbol (comments) are ignored. Additionally, the following standard variables are available: Arch The current host architecture (i.e. the architecture the package is being built for, the equivalent of DEB_HOST_ARCH). source:Version The source package version (since dpkg 1.13.19). source:Upstream-Version The upstream source package version, including the Debian version epoch if any (since dpkg 1.13.19). binary:Version The binary package version (which may differ from source:Version in a binNMU for example; since dpkg 1.13.19). Source-Version The source package version (from the changelog file). This variable is now obsolete and emits an error when used as its meaning is different from its function, please use the source:Version or binary:Version as appropriate. source:Synopsis The source package synopsis, extracted from the source stanza Description field, if it exists (since dpkg 1.19.0). source:Extended-Description The source package extended description, extracted from the source stanza Description field, if it exists (since dpkg 1.19.0). Installed-Size The approximate total size of the package's installed files. This value is copied into the corresponding control file field; setting it will modify the value of that field. If this variable is not set dpkg-gencontrol will compute the default value by accumulating the size of each regular file and symlink rounded to 1 KiB used units, and a baseline of 1 KiB for any other filesystem object type. Note: Take into account that this can only ever be an approximation, as the actual size used on the installed system will depend greatly on the filesystem used and its parameters, which might end up using either more or less space than the specified in this field. Extra-Size Additional disk space used when the package is installed. If this variable is set its value is added to that of the Installed-Size variable (whether set explicitly or using the default value) before it is copied into the Installed-Size control file field. S:fieldname The value of the source stanza field fieldname (which must be given in the canonical capitalisation; since dpkg 1.18.11). Setting these variables has no effect other than on places where they are expanded explicitly. These variables are only available when generating binary control files. F:fieldname The value of the output field fieldname (which must be given in the canonical capitalisation). Setting these variables has no effect other than on places where they are expanded explicitly. Format The .changes file format version generated by this version of the source packaging scripts. If you set this variable the contents of the Format field in the .changes file will change too. Newline, Space, Tab These variables each hold the corresponding character. shlibs:dependencyfield Variable settings with names of this form are generated by dpkg-shlibdeps. dpkg:Upstream-Version The upstream version of dpkg (since dpkg 1.13.19). dpkg:Version The full version of dpkg (since dpkg 1.13.19). If a variable is referred to but not defined it generates a warning and an empty value is assumed. FILES
debian/substvars List of substitution variables and values. SEE ALSO
dpkg(1), dpkg-genchanges(1), dpkg-gencontrol(1), dpkg-shlibdeps(1), dpkg-source(1). 1.19.0.5 2018-04-16 deb-substvars(5)
All times are GMT -4. The time now is 07:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy