Sponsored Content
Top Forums Shell Programming and Scripting Extracting information using awk Post 302797343 by joeyg on Monday 22nd of April 2013 11:57:39 AM
Old 04-22-2013
Code:
$ echo Mem: 100M Active, 2150K Cache, 500M Buf, 10G Free | awk '{print $8}'
10G

$ echo Mem: 100M Active, 2150K Cache, 500M Buf, 10G Free | awk '{print substr($8,length($8),1)}'
G

The first line shows how to extract.
The 2nd line pulls the 'G' out. You will need to analyze for all the possibilities - K, M, G, ??? to convert and create a number.
This User Gave Thanks to joeyg For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting information from a template

I have a template that I usually use to generate stats on an hourly basis for a number of cell sites altogether. I would like to be able to write a script that would go to the template and extract the information for any single site at any time during the day. For example, let's say that my... (4 Replies)
Discussion started by: Ernst
4 Replies

2. UNIX for Dummies Questions & Answers

Extracting information from text fields.

Dear friends, I'm a novice Unix user and I'm trying to learn the ropes. I have a big task I have to accomplish and I'm convinced Unix can get the job done, I just haven't figured out how. I recently posted on the topic of cutting text between unique text patterns and somebody helped me a great... (24 Replies)
Discussion started by: spindoctor
24 Replies

3. Shell Programming and Scripting

Problems with extracting information

Hi all, <select name="comp" id="comp" style="width:130px;"> <?php $sqlcomp = mysql_query("SELECT * FROM comp"); while ($redcomp = mysql_fetch_array($sqlcomp)) { extract($redcomp); echo "<option value=\"$comp_id\">comp_name</option>"; } ?> ... (0 Replies)
Discussion started by: c0mrade
0 Replies

4. Shell Programming and Scripting

Extracting information and creating numeric values using awk

I have some variables containing for example m02-npt02-sr40-syn-dv0p01-16x12drw m02-npt02-sr40-syn-dv0p02-16x12drw m02-npt02-sr40-dv0p03-syn-16x12drw I want to extract the dv entry for example dv0p01 dv0p02 dv0p03 Then I want to convert to a numeric, the p specifies the... (5 Replies)
Discussion started by: kristinu
5 Replies

5. Programming

extracting information from lines, put them into arrays

hi I need a little help writing this small perl script. I'm trying to extract the values from each line in a file and find the average for example cat school Highschool 100, 123, 135 Middleschool 41, 67, 54 Elementary 76, 315, 384 ./average.pl highschool: 119.3 middleschool: 54... (2 Replies)
Discussion started by: gengar
2 Replies

6. Shell Programming and Scripting

extracting information from multiple files

Hello there, I am trying to extract (string) information ( a list words) from 4 files and then put the results into 1 file. Currently I am doing this using grep -f list.txt file1 . and repeat the process for the other 3 files. The reasons i am doing that (a) I do know how to code (b) each file... (4 Replies)
Discussion started by: houkto
4 Replies

7. Shell Programming and Scripting

Extracting relevant information from syslogs.

I need to analyse some syslogs and I want to print out all the lines containing SSH connections to the inside interface of the firewall and ignore lines where the originating port is 22. So basically I want to print all matches after "to inside:" that contains /22 and ignore lines where /22 occur... (2 Replies)
Discussion started by: lewk
2 Replies

8. Shell Programming and Scripting

Problems extracting some information

Hi there! Well, I'm writing a script to obtain certain information about files. Specifically, I want to get the information about those files which last access were in the last 24 hours, so I'm doing something like this: find <directory_name> -atime -1 -printf '%f %a\n' I would also... (4 Replies)
Discussion started by: Skirmish
4 Replies

9. Shell Programming and Scripting

[Solved] Extracting information from DDL's

Dear Experts, I need your help here. I have lot of teradata DDL's as follows, i want to extract field names , field attributes and NOT NULL information from DDL.Could you please help here. Sample DDL: CREATE MULTISET TABLE APS_CALL_IN_PICKUP_CANCELED ,NO FALLBACK , NO BEFORE... (2 Replies)
Discussion started by: srikanth38
2 Replies

10. Shell Programming and Scripting

Extracting information from XML to excel

Hi, I am trying to extract information from a XML file and write it to a excel sheet. I am not sure where to start from. Here is the content from my input XML file. <com.cloudbees.hudson.plugins.folder.properties.FolderProxyGroupContainer plugin="nectar-rbac@4.5"> <groups> ... (4 Replies)
Discussion started by: Sajjadmehdi
4 Replies
MXGE(4) 						   BSD Kernel Interfaces Manual 						   MXGE(4)

NAME
mxge -- Myricom Myri10GE 10 Gigabit Ethernet adapter driver SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file: device firmware device mxge Alternatively, to load the driver as a module at boot time, place the following lines in loader.conf(5): if_mxge_load="YES" mxge_ethp_z8e_load="YES" mxge_eth_z8e_load="YES" mxge_rss_ethp_z8e_load="YES" mxge_rss_eth_z8e_load="YES" DESCRIPTION
The mxge driver provides support for PCI Express 10 Gigabit Ethernet adapters based on the Myricom LANai Z8E chip. The driver supports Transmit/Receive checksum offload, Jumbo Frames, TCP segmentation offload (TSO) as well as Large Receive Offload (LRO). For further hardware information, see http://www.myri.com/. For questions related to hardware requirements, refer to the documentation supplied with your Myri10GE adapter. All hardware requirements listed apply to use with FreeBSD. Support for Jumbo Frames is provided via the interface MTU setting. Selecting an MTU larger than 1500 bytes with the ifconfig(8) utility configures the adapter to receive and transmit Jumbo Frames. The maximum MTU size for Jumbo Frames is 9000. For more information on configuring this device, see ifconfig(8). HARDWARE
The mxge driver supports 10 Gigabit Ethernet adapters based on the Myricom LANai Z8E chips: o Myricom 10GBase-CX4 (10G-PCIE-8A-C, 10G-PCIE-8AL-C) o Myricom 10GBase-R (10G-PCIE-8A-R, 10G-PCIE-8AL-R) o Myricom 10G XAUI over ribbon fiber (10G-PCIE-8A-Q, 10G-PCIE-8AL-Q) LOADER TUNABLES
Tunables can be set at the loader(8) prompt before booting the kernel or stored in loader.conf(5). hw.mxge.flow_control_enabled Whether or not hardware flow control is enabled on the adapter. The default value is 1. hw.mxge.intr_coal_delay This value delays the generation of all interrupts in units of 1 microsecond. The default value is 30. hw.mxge.skip_pio_read This value determines whether or not the driver may omit doing a PIO read in the interrupt handler which ensures that the interrupt line has been deasserted when using xPIC interrupts. A non-zero value may result in lower CPU overhead, however it may also result in spurious interrupts. The default value is 0. This tunable has no effect when the device is using MSI or MSI-X interrupts. hw.mxge.max_slices This value determines the maximum number of slices the driver will attempt to use. The default value is 1. A slice is comprised of a set of receive queues and an associated interrupt thread. When using multiple slices, the NIC hashes traffic to different slices based on the value of hw.mxge.rss_hashtype. Using multiple slices requires that your motherboard and Myri10GE NIC both be capable of MSI-X. Older Myri10GE NICs can be field upgraded to add MSI-X using the "10G NIC Tool Kit" for FreeBSD which is available from http://www.myri.com/scs/download-10g-tools.html. hw.mxge.rss_hashtype This value determines how incoming traffic is steered to different slices. This tunable is ignored when using just a single slice. The legal values for this tunable are: 1 Hash on the source and destination IPv4 addresses. 2 Hash on source and destination IPv4 addresses and if the packet is TCP, then also hash on the TCP source and destination ports. 4 Hash on the TCP or UDP source ports. This is the default value. DIAGNOSTICS
mxge%d: Unable to allocate bus resource: memory A fatal initialization error has occurred. mxge%d: Unable to allocate bus resource: interrupt A fatal initialization error has occurred. mxge%d: Could not find firmware image %s The appropriate firmware kld module was not installed. This is a non-fatal initialization error, but will result in running in a reduced performance mode. SUPPORT
For general information and support, go to the Myricom support website at: http://www.myri.com/scs/. If an issue is identified with the released source code on the supported kernel with a supported adapter, email the specific information related to the issue to <help@myri.com>. SEE ALSO
altq(4), arp(4), netintro(4), ng_ether(4), ifconfig(8) HISTORY
The mxge device driver first appeared in FreeBSD 6.3. AUTHORS
The mxge driver was written by Andrew Gallatin <gallatin@FreeBSD.org>. BSD
February 13, 2008 BSD
All times are GMT -4. The time now is 11:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy