Sponsored Content
Full Discussion: Some Awk Getline help?
Top Forums Shell Programming and Scripting Some Awk Getline help? Post 302426658 by Franklin52 on Wednesday 2nd of June 2010 12:52:36 PM
Old 06-02-2010
Try this:
Code:
awk 'NR==FNR{a[$1]=$1;next}a[$1]' subset.txt file.dat*

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk:Problem with getline

$ echo |awk ' BEGIN {"date" | getline current_time;close("date");print "Report printed on " current_time}' Report printed on Thu May 11 14:57:29 METDST 2006 This example works fine but how can i print all the output when is longer... (3 Replies)
Discussion started by: Klashxx
3 Replies

2. Shell Programming and Scripting

awk getline help maybe?

hello collegues, I am attempting to use awk to search file1 (serverlist.csv) from each row with file2 (supported.txt). If the is no entry exists in serverlist then output to a file called notsupp.out if there is an entry output to supp.out I can do this with basic shell scripting however... (0 Replies)
Discussion started by: chlawren
0 Replies

3. Shell Programming and Scripting

awk and system getline

Hello, Need some help here. I have this script (test.sh): #!/bin/sh var=$1 (( var = 2 * var )) echo $var Now I want to call this script from awk with one argument and then capture the result in a variable, something like: echo 40 | awk ' { x = $1; "test.sh " x | getline y; print y }... (1 Reply)
Discussion started by: fbg
1 Replies

4. Shell Programming and Scripting

awk getline

How do you make the getline function return to the original line? The example below should make it clear where I am currently going wrong. Thanks AWK SCRIPT: ------------- awk -F '-' '{ tmpLine = "EMPTY" print "CURRENT LINE :"$0 getline tmpLine print "NEXT LINE :"tmpLine }'... (1 Reply)
Discussion started by: garethsays
1 Replies

5. Shell Programming and Scripting

Using getline in awk

I am using awk and want to use getline from a file like below getline x < file However file consists of two columns and I only want to store $2 Any way I can do this? ---------- Post updated at 06:54 AM ---------- Previous update was at 06:45 AM ---------- Done something like this.... (1 Reply)
Discussion started by: kristinu
1 Replies

6. Shell Programming and Scripting

awk getline question

Hi there, I have an ifconfig output and i want to write a script that determines whether there is a line "groupname ipmp" on a particular interface here is my example ifconfig -a output lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1... (2 Replies)
Discussion started by: rethink
2 Replies

7. Shell Programming and Scripting

awk getline t file

I want to import a textfile with getline into var t which has several lines. How do import all lines, since it only imports the last line: while < ((getline t "textfile") > 0) (7 Replies)
Discussion started by: sdf
7 Replies

8. Shell Programming and Scripting

awk getline problem

Hello, I want to print out the DNA sequence entries (tens of thousand!) that are longer than certain value (i=200) from a file (FASTA file) as: >S94D_ctg_8004 Average coverage: 402.95 ATAATGCCTGTGAATATGACATGTGTTCCTGTTTCTACATCAGACTACTATTCTTGCATA... (12 Replies)
Discussion started by: yifangt
12 Replies

9. Shell Programming and Scripting

awk getline

Hi, I have an awk script with the following function in it . function cmd( c ) { while( ( c | getline foo) > 0 ){ return foo ; close( c ); } } c =... (4 Replies)
Discussion started by: MetaMan
4 Replies

10. Shell Programming and Scripting

awk with if, getline, and another if

Howdy Folks, It seems like it is always awk that confuses the heck out of me and I even have books and examples. I have this line: awk '{if (/clientIP/)(SRV = $NF); if ($2 ~ /BUNDLE-GIM/) getline; if ($2 ~ /r100595/) {print SRV,"BUNDLE-GIM",$2}}' post.txt to parse this text: <api... (4 Replies)
Discussion started by: port43
4 Replies
sizer(8)						      System Manager's Manual							  sizer(8)

NAME
sizer - Displays information about the system or kernel, or creates a system configuration file SYNOPSIS
/usr/sbin/sizer [-atm] [-b] [-c] [-gr] [-gt] [-implver] [-l] [-m] [-M] [-nfilename] [-p] [-pr] [-P] [-r] [-v] [-wc] [-wk] [-wp] [-wt] [-wu] OPTIONS
Indicates whether an ATM (Asynchronous Transfer Mode) adapter is present. Displays the name of the file from which the running kernel was booted. Displays the CPU type of the running CPU. Displays an ASCII string (terminated by a line feed) that specifies the size, in pix- els, for each graphics screen that exists in the system. The information is displayed in the following format: width x height. For exam- ple, 1280x1024 specifies the default graphics screen on a DEC 3000 Model 500 system. The resolutions of all the existing screens are dis- played on a single line in the same order as the ROM ID strings that are displayed by the -gt option. If no screens exist in the system, then 0x0 is displayed. Displays an ASCII ROM ID string (terminated by a line feed) for each graphics screen that exists in the system. The ROM ID string identifies the graphics controller for the screen. Some controllers can manage more than one physical or logical screen. If there are no screens in the system, then nothing is returned. Displays the family name to which the processor belongs. This can be EV4, EV5 or EV6. Displays the option for the small-memory system, or zero. Displays the running kernel's module list, if that kernel was linked at boot time. The information displayed is a space-separated list detailing the exact linker options and module names used to boot- strap link the running kernel. If the running kernel is a statically linked image, sizer displays an empty string. Displays the names of foreign kits that were linked into the running kernel at boot time, including the name of the device from which they were loaded. The device name is the one known to the console. (For example, on a DEC 3000 system, the device name for a CD-ROM device is dka400). If the running kernel is a statically linked image, sizer displays an empty string. Creates a configuration file. The -n option creates a con- figuration file in /tmp/filename and a shell script named /tmp/filename.devs that runs MAKEDEV to create devices such as Lcam. The system should be running the /genvmunix generic kernel to ensure that all required devices and options are available. Note that disk and tape device special files are created using dsfmgr(8). Note You should run doconfig to build a new kernel. Displays the number of available CPUs. Displays the number of CPUs that are cur- rently running on the system. Provides information on logical partitions. Displays the name of the root device. Displays the operating system version string. Displays the type of workstation console. This number indicates whether a graphics head was cho- sen as the system console at boot time, or whether the alternate (serial interface) console was chosen. If a graphics console was chosen, a zero (0) is returned to standard output. If an alternate console was chosen, a one (1) is returned to standard output. Displays an ASCII string that identifies the workstation keyboard if one exists in the system. For example, LK401 specifies the default keyboard on the DEC 3000 Model 500 system. Displays an ASCII string that identifies the workstation pointer if one exists in the system. For example, VSXXXAA specifies the mouse on a DEC 3000 Model 500 system. Displays the type of workstation display. This number specifies each byte, which indicates a type of display, with one byte used for each display. The limit is zero to four displays. Displays the workstation display units. This number specifies the "on" bits, which indicate the display units that exist on the system. For example, the return number 1 indicates that one display exists, the return number 3 indicates that two displays exist, the return number 7 indicates that three displays exist, and the return number 15 indicates that 4 displays exist. The limit is zero to four displays. DESCRIPTION
The sizer program reports information about the running system, including the name of the kernel file. This program is also used by the doconfig program to create a system configuration file. Note that if you use sizer with the -n option to create a configuration file, it may differ from the current configuration on your system. For example, customizations may not appear in the output from sizer. SEE ALSO
Commands: config(8), doconfig(8) System Administration sizer(8)
All times are GMT -4. The time now is 02:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy