Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Required column output should be arranged in awk Post 303042748 by blackrageous on Sunday 5th of January 2020 08:42:31 PM
Old 01-05-2020
Your parameters seem to actually be $5 and $6. You can do something like...
Code:
awk '{printf("%5s%10s\n",$5,$6)}' <filename>

or
Code:
awk '{printf("%-5s%10s\n",$5,$6)}' <filename>

This User Gave Thanks to blackrageous For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

finding greatest value in a column using awk from iostat output in linux

Friends, . On linux i have to run iostat command and in each iteration have to print the greatest value in each column. e.g iostat -dt -kx 2 2 | awk ' !/sd/ &&!/%util/ && !/Time/ && !/Linux/ {print $12}' 4.38 0.00 0.00 0.00 What i would like to print is only the... (3 Replies)
Discussion started by: achak01
3 Replies

2. Shell Programming and Scripting

finding greatest value in a column using awk from iostat output in linux

Friends, Need some help. On linux i have to run iostat command and in each iteration have to print the greatest value in each column. e.g iostat -dt -kx 2 2 | awk ' !/sd/ &&!/%util/ && !/Time/ && !/Linux/ {print $12}' 4.38 0.00 0.00 0.00 WHhat i would like to... (15 Replies)
Discussion started by: achak01
15 Replies

3. Shell Programming and Scripting

Find in first column and replace the line with Awk, and output new file

Find in first column and replace the line with Awk, and output new file File1.txt"2011-11-02","Georgia","Atlanta","x","","" "2011-11-03","California","Los Angeles","x","","" "2011-11-04","Georgia","Atlanta","x","x","x" "2011-11-05","Georgia","Atlanta","x","x","" ... (4 Replies)
Discussion started by: charles33
4 Replies

4. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

5. Shell Programming and Scripting

Want to sort a file using awk & sed to get required output

Hi All, Need Suggestion, Want to sort a file using awk & sed to get required, output as below, such that each LUN shows correct WWPN and FA port Numbers correctly: Required output: 01FB 10000000c97843a2 8C 0 01FB 10000000c96fb279 9C 0 22AF 10000000c97843a2 8C 0 22AF 10000000c975adbd ... (10 Replies)
Discussion started by: aix_admin_007
10 Replies

6. Shell Programming and Scripting

How to sum multiple column output with awk ?

Hi Experts, I am trying to sum multiple columns and rows with awk , I want the sum of : 1] Horizontal Sum: (rows sum): 2] Vertical Sum: (Column's sum] details: # cat file1 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 40 31 32 33 34 35 36 37 38 39 70 41 42 43 44... (2 Replies)
Discussion started by: rveri
2 Replies

7. UNIX for Dummies Questions & Answers

Print each output of loop in new column using awk or shell

I have this output from a loop a11 1,2 3,4 5,6 7,8 12,8 5,4 3,6 a12 10,11 12,13 15,18 20,22 a13 ... (3 Replies)
Discussion started by: maryre89
3 Replies

8. Shell Programming and Scripting

awk or grep to search one column and output the other

Hello, it would be great if someone can help me with the following: I want to search for the rows from fileA in column 1 of fileB and output column 2 of fileB if found in fileC. In the moment I search within the complete file. How can I change the code so only column 1 is searched? cat fileA... (7 Replies)
Discussion started by: Manyaka
7 Replies

9. UNIX for Advanced & Expert Users

Parse output and then compare column wise with awk

Hello, I am trying to write a script to parse the output of data and then alert based on certain conditions This is the output of my script (STRING) Name = Joe (FLOAT64) BMI = 34 (FLOAT64) Weight = 156 (STRING) Name = Sam (FLOAT64) BMI = 32 (FLOAT64) Weight = 180 and so on it repeats... (4 Replies)
Discussion started by: sidnow
4 Replies

10. UNIX for Beginners Questions & Answers

Convert rows to column and print output in required format

Hi All, i am trying to print the solaris 11 packages in below required format, But i am unable to do that. Current ouput : root@abc# pkginfo -l | egrep '(BASEDIR|NAME|VERSION)' | awk '{print}' NAME: QLogic 570x/571x Gigabit Ethernet Driver VERSION: 11.11,REV=2009.11.11 ... (7 Replies)
Discussion started by: balu1234
7 Replies
ippool(4)							   File Formats 							 ippool(4)

NAME
ippool, ippool.conf - IP pool file format SYNOPSIS
ippool.conf DESCRIPTION
The format for files accepted by ippool(1M) is described by the following grammar: line ::= table | groupmap . table ::= "table" role tabletype . groupmap ::= "group-map" inout role number ipfgroup tabletype ::= ipftree | ipfhash . role ::= "role" "=" "ipf" . inout ::= "in" | "out" . ipftree ::= "type" "=" "tree" number "{" addrlist "}" . ipfhash ::= "type" "=" "hash" number hashopts "{" hashlist "}" . ipfgroup ::= setgroup hashopts "{" grouplist "}" | hashopts "{" setgrouplist "}" . setgroup ::= "group" "=" groupname . hashopts ::= size [ seed ] | seed . size ::= "size" "=" number . seed ::= "seed" "=" number . addrlist ::= range [ "," addrlist ] . grouplist ::= groupentry [ ";" grouplist ] | groupentry ";" | addrmask ";" | addrmask ";" [ grouplist ] . setgrouplist ::= groupentry ";" [ setgrouplist ] . groupentry ::= addrmask "," setgroup . range ::= addrmask | "!" addrmask . hashlist ::= hashentry ";" [ hashlist ] . hashentry ::= addrmask . addrmask ::= ipaddr | ipaddr "/" mask . mask ::= number | ipaddr . groupname ::= number | name . number ::= digit { digit } . ipaddr = host-num "." host-num "." host-num "." host-num . host-num = digit [ digit [ digit ] ] . digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" . name ::= letter { letter | digit } . The IP pool configuration file is used for defining a single object that contains a reference to multiple IP address/netmask pairs. A pool can consist of a mixture of netmask sizes, from 0 to 32. In the current release, only IPv4 addressing is supported in IP pools. The IP pool configuration file provides for defining two different mechanisms for improving speed in matching IP addresses with rules. The first, table, defines a lookup table to provide a single reference in a filter rule to multiple targets. The second mechanism, group-map, provides a mechanism to target multiple groups from a single filter line. The group-map command can be used only with filter rules that use the call command to invoke either fr_srcgrpmap or fr_dstgrpmap, to use the source or destination address, respectively, for determining which filter group to jump to next for continuation of filter packet pro- cessing. Pool Types Two storage formats are provided: hash tables and tree structure. The hash table is intended for use with objects that all contain the same netmask or a few, different sized-netmasks of non-overlapping address space. The tree is designed for supporting exceptions to a covering mask, in addition to normal searching as you would do with a table. It is not possible to use the tree data storage type with group-map configuration entries. Pool Roles When a pool is defined in the configuration file, it must have an associated role. At present the only supported role is ipf. Future devel- opment might see further expansion of the use of roles by other sections of IPFilter code. EXAMPLES
The following examples show how the pool configuration file is used with the ipf configuration file to enhance the succinctness of the lat- ter file's entries. Example 1: Referencing Specific Pool The following example shows how a filter rule makes reference to a specific pool for matching of the source address. pass in from pool/100 to any The following pool configuration matches IP addresses 1.1.1.1 and any in 2.2.0.0/16, except for those in 2.2.2.0/24. table role = ipf type = tree number = 100 { 1.1.1.1/32, 2.2.0.0/16, !2.2.2.0/24 }; Example 2: ipf Configuration Entry The following ipf.conf excerpt uses the fr_srcgrpmap/fr_dstgrpmap lookups to use the group-map facility to look up the next group to use for filter processing, providing the call filter rule is matched. call now fr_srcgrpmap/1010 in all call now fr_dstgrpmap/2010 out all pass in all group 1020 block in all group 1030 pass out all group 2020 block out all group 2040 An ippool configuration to work with the preceding ipf.conf segment might look like the following: group-map in role = ipf number = 1010 { 1.1.1.1/32, group = 1020; 3.3.0.0/16, group = 1030; }; group-map out role = ipf number = 2010 group = 2020 { 2.2.2.2/32; 4.4.0.0/16; 5.0.0.0/8, group = 2040; }; FILES
o /dev/ippool o /etc/ipf/ippool.conf o /etc/hosts ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWipfu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
ipf(1M), ipnat(1M), ippool(1M), ipf(4), attributes(5), hosts(4) SunOS 5.10 30 Apr 2004 ippool(4)
All times are GMT -4. The time now is 01:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy