Since you are only reading one file, NR will always be the same as FNR so there is no reason to include that test as it's always true. Secondly, it's never good form to use a variable, i in this case, for loop control when it is used outside of the loop with the assumption that it has some previously sane value.
Here is an example that illustrates two methods, one if output order must match the same order that field 1 was seen, and one if any output order is ok.
I just noticed you're using nawk, you can replace awk with nawk in the examples and you should be fine.
Last edited by agama; 06-05-2011 at 05:54 PM..
Reason: clarification
We're trying to install a third T3 array onto our V880. The other two T3's are connected to a qlogic fibre card. We can see this connection fine when we do a luxadm probe -p command. The full device paths are shown etc. ie: the first T3's logical name is c2t1d0 and the second one is c3t1d0.
... (3 Replies)
#!/bin/ksh
let i=0
set -A array
array{1}="qqqqqqqqqqqqqqqqqqq"
when run got error
t1: array{1}=qqqqqqqqqqqqqqqqqqq: not found
Whats wrong here
Thanks in advance (2 Replies)
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Hi,
I have one file in this format
20 value1
33 value2
56 value3
I have another file in this format:
34,30-SEP-09,57,100237775,33614510126,2,34
34,30-SEP-09,57,100237775,33620766654,2,34
34,30-SEP-09,108,100237775,33628458122,2,34
34,30-SEP-09,130,100237775,33635266741,2,254... (6 Replies)
Issue with disk space usage
I have the following line in my "df -h" output:
Filesystem Size Used Avail Capacity Mounted on
/dev/ad4s1a 496M 495M -39M 109% /
What is the issue with having 9% excess utilisation? How can I find out what this partition is... (2 Replies)
Hi guys,
I'm a scripting noob in need of some help :)
I am creating a script that checks the filesystems and will alert based upon if the percent full is greater than the threshold set.
The problem that I am having is that when I set the 'filesystem' variable, all of the output is treated as... (12 Replies)
Hi,
I need a help in setting scope of the variable. I want to use the below logic right before the "break" statement
if ; then
echo $header
echo $trailer
fi
But due the scope of the variable it is causing issues. I tried using "export" statement. But it changes the output completely
... (0 Replies)
Hello All,
Can you please help me with the below.
#!/bin/bash
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1"
ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Hi,
Here's an example of what I my issue, a file list.txt, which looks like:
a
b
c
d
e
I have been trying to use the following code to simply print the list using awk and next:
awk 'FNR==NR{a=$1;next}{print a}' list.txt
this give no output, even though I would expect it to type out... (5 Replies)
Discussion started by: hexy
5 Replies
LEARN ABOUT X11R4
xkbkeyaction
XkbKeyAction(3) XKB FUNCTIONS XkbKeyAction(3)NAME
XkbKeyAction - Returns the key action
SYNOPSIS
XkbAction XkbKeyAction ( xkb, keycode, idx )
XkbDescPtr xkb;
KeyCode keycode;
int idx;
ARGUMENTS
- xkb Xkb description of interest
- keycode
keycode of interest
- idx index for group and shift level
DESCRIPTION
A key action defines the effect key presses and releases have on the internal state of the server. For example, the expected key action
associated with pressing the Shift key is to set the Shift modifier. There is zero or one key action associated with each keysym bound to
each key.
Just as the entire list of key symbols for the keyboard mapping is held in the syms field of the client map, the entire list of key actions
for the keyboard mapping is held in the acts array of the server map. The total size of acts is specified by size_acts, and the number of
entries is specified by num_acts.
The key_acts array, indexed by keycode, describes the actions associated with a key. The key_acts array has min_key_code unused entries at
the start to allow direct indexing using a keycode. If a key_acts entry is zero, it means the key does not have any actions associated with
it. If an entry is not zero, the entry represents an index into the acts field of the server map, much as the offset field of a
KeySymMapRec structure is an index into the syms field of the client map.
The reason the acts field is a linear list of XkbActions is to reduce the memory consumption associated with a keymap. Because Xkb allows
individual keys to have multiple shift levels and a different number of groups per key, a single two-dimensional array of KeySyms would
potentially be very large and sparse. Instead, Xkb provides a small two-dimensional array of XkbActions for each key. To store all of these
individual arrays, Xkb concatenates each array together in the acts field of the server map.
The key action structures consist only of fields of type char or unsigned char. This is done to optimize data transfer when the server
sends bytes over the wire. If the fields are anything but bytes, the server has to sift through all of the actions and swap any nonbyte
fields. Because they consist of nothing but bytes, it can just copy them out.
XkbKeyAction returns the key action indexed by idx in the two-dimensional array of key actions associated with the key corresponding to
keycode.idx may be computed from the group and shift level of interest as follows:
idx = group_index * key_width + shift_level
STRUCTURES
The KeySymMapRec structure is defined as follows:
#define XkbNumKbdGroups 4
#define XkbMaxKbdGroup (XkbNumKbdGroups-1)
typedef struct { /* map to keysyms for a single keycode
*/
unsigned char kt_index[XkbNumKbdGroups]; /* key type index for
each group */
unsigned char group_info; /* # of groups and out of range group
handling */
unsigned char width; /* max # of shift levels for key */
unsigned short offset; /* index to keysym table in syms array
*/
} XkbSymMapRec, *XkbSymMapPtr;
X Version 11 libX11 1.2.1 XkbKeyAction(3)