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
FORKTRACER.CONF(5)						File Formats Manual						FORKTRACER.CONF(5)

NAME
forktracer.conf - apt-forktracer configuration file DESCRIPTION
apt-forktracer reports "non-standard" packages which are installed in the system. The configuration files let you ignore (skip reporting) some of them, provided they meet certain criteria. The program reads the /etc/apt/forktracer.conf file, as well as /etc/apt/fork- tracer.d/*.conf (skipping hidden files). A config file consists of any number of stanzas, separated with at least one empty lines. A stanza has the following format: Package: package Accept-Origin: origin1 Track-Origin: origin2 Track-Version: version All these lines in a stanza are required, and they have the following meaning: package the name of the package to which this stanza applies origin1 the value of the Origin field of the source, from which a package should be ignored. A package will be ignored, if its candidate version comes from source1, and at the same time meets the condition given by the Track-* fields. A special value * means, that a package should be ignored regardless of the source of the candidate version. origin2 the value of the Origin field of the source, from which the newest available version should be tracked. A special value * means, that a generally newest available version should be tracked, regardless of source. version is the required version string available from the origin2 source. Apart from a literal version string, the following special values may be used: =candidate, which means the current candidate version, and =candidate-base, which means the base version (see below) of the current candidate version. The above stanza would cause package to be skipped from program output, as long as its candidate version comes from origin1, and at the same time its newest version available from origin2 equals version. If there is more than one stanza for a given package, then it is omitted from the program output if at least one of them matches the cur- rent situation. Base version definition A base version is extracted from a given version by stripping from its end the shortest string starting with a tilde character. For example for version 1:1.2-3~4~5 the base version is 1:1.2-3~4. Default configuration If for a given package package there is no stanza in the configuration, then the program acts as if the following two stanzas existed: Package: package Accept-Origin: * Track-Origin: distributor Track-Version: =candidate Package: package Accept-Origin: * Track-Origin: distributor Track-Version: =candidate-base where distributor is the system distributor's identifier, as returned by lsb_release --id or by the DISTRIB_ID field in the /etc/lsb- release file. EXAMPLES
Unofficial package apt-forktracer reports packages which are not available from any official source, for example: puppet-softwarelab (0.2) [SoftwareLab: 0.2 0.1] The following stanza makes it skip such packages: Package: puppet-softwarelab Accept-Origin: SoftwareLab Track-Origin: * Track-Version: =candidate If the puppet-softwarelab package will be "pinned" to "release o=Softwarelab", then such configuration will make apt-forktracer report if puppet-softwarelab appears in any source other than SoftwareLab in a version newer than the one available from it. Backport Installing a backport has a similar effect to installing an unofficial package: spamc (3.2.3-0.volatile1) [Debian: 3.1.7-2] [volatile.debian.org: 3.2.3-0.volatile1] The following stanza will cause such package to be skipped: Package: spamc Accept-Origin: volatile.debian.org Track-Origin: * Track-Version: =candidate In this situation a small official version string change (for example to 3.1.7-2etch1) will be silently ignored. Such configuration is therefore only suitable for cases where you trust the person providing the backport to carefully track changes in the stable edition and make sure they are incorporated in the backport they are distributing. In other cases, you should probably use the following configura- tion. Own modifications Sometimes there is a situation where you make minor changes to a package, and you would like to know when a new official stable version is released, so that you can update your modified version. policyd-weight (0.1.14-beta-6etch2.0.sl.1) [Debian: 0.1.14-beta-6etch2] [SoftwareLab: 0.1.14-beta-6etch2.0.sl.1] The following configuration is useful in such cases: Package: policyd-weight Accept-Origin: SoftwareLab Track-Origin: Debian Track-Version: 0.1.14-beta-6etch2 It is worth mentioning, that if you apply a certain convention when numbering the modified version, then the Default configuration described before is sufficient. In this case, if the modified version would have a version number such as 0.1.14-beta-6etch2~sl.1 then the above-mentioned stanza would be unnecessary. What is more, there would be no need to keep any configuration up-to-date in case of new sta- ble version releases, because the default configuration is created dynamically based on the current situation. FILES
/etc/apt/forktracer.conf /etc/apt/forktracer.d/*.conf SEE ALSO
apt-cache(8), apt-forktracer(8), apt_preferences(5). Debian Project 2008-11-16 FORKTRACER.CONF(5)
All times are GMT -4. The time now is 01:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy