I have written many awk commands which go in multiple lines.
I have this confusion many times.
Some time they work if i dont terminate them with "\" but some time error.
Some time in "if" statements between if and else if i dont use ";" it gives error but sometimes it doesnt.
The below... (4 Replies)
Hi I am trying to understand AWK syntax
so I tried this command which gives me the home directory of root
awk 'BEGIN { FS = ":"} {if ($1 == "root") print $6 }' /etc/passwd
I would know what are the following commands doing. The first one prints all /etc/passwd, second prints nothing.
... (4 Replies)
Little bit confusing while using awk :confused::confused:
In Sed while pattern search we can use "(double quotes)
i mean
$a=hello
$cat file.txt |sed -n "/$a/p"this thing work fine But if i use it in awk it's not working How could i do the substitution of pattern by a variables and the... (1 Reply)
i have a ksh code that needs to be written in AWK. can someone please help me here? :(
if }" | grep -c "$2") -gt 0 ] ; then
print - "found $2 in array ignore"
else
print - "did not find $2 in array ignore"
fi
ignore=4ty56r
ignore=er45ty
.
.
.
ignore=frhtg2 (27 Replies)
I have a file which is comma separated and has quotes. I can use this command and
awk -F"," '{ if ($4=="01" print $0 }' test.txt
But this doesn't fetch me the data.since it has quotes.
If the data has no quotes,the above command works fine.
In Unix you can skip quote \" but this doesn't work.... (7 Replies)
Hi I have a bash file which will split a big file to many small files.
But I got a syntax error.H="$(head -1 CCC.tped)"
awk 'print $0 > $1 ".tped"' CCC.tped
for f in $(ls *.tped); do echo "$H\n" "$(cat $f)" >$f; done
And
-bash-4.1$ bash split
awk: print $0 > $1".tped"
awk: ^ syntax error... (3 Replies)
Hi, I would like to know what is the correct syntax to perform a function in awk. Although I have seen several examples, not get it to work, this is what I'm trying:
#!/bin/bash
awk
function multi (number) {
return number * 3
}
print multi (4)Thanks (2 Replies)
Hello,
I have perl script,which take some part of data in the file.
the below command works fine in normal cmd prompt.
`awk '/CDI/ && // && !/Result for/ {print $3 $5 > "final.txt"}' datalist.txt`;
`nawk -F"" '{print $2}' finalcdi.txt`;
But not working.
Please use code tags, thanks. (5 Replies)
Hello Experts:
While writing a script to help one of the posts on here, I end up writing a wrong one. I am very much eager to know how this can be corrected.
Aim was to not print specified columns - lets say out of 100 fields, need to print all but 5th, 10th, 15th columns.
Someone already... (13 Replies)
awk -F, ' NR>1 {
BEGIN{
chr=$2
}
END{
for (k in chr) {print k}
}
} ' $gene_file
I've a really simple code. I want to store gene name and it's chromosome and in the end print them.
I'm skipping line one as it contains headers.
But I don't know why I get error as: (2 Replies)
Discussion started by: genome
2 Replies
LEARN ABOUT HPUX
xsetpointermapping
XSetPointerMapping() XSetPointerMapping()
Name
XSetPointerMapping - set the pointer button mapping.
Synopsis
int XSetPointerMapping(display, map, nmap)
Display *display;
unsigned char map[];
int nmap;
Arguments
display Specifies a connection to an X server; returned from XOpenDisplay().
map Specifies the mapping list.
nmap Specifies the number of items in the mapping list.
Returns
MappingSuccess on success; MappingBusy on failure.
Description
XSetPointerMapping() sets the mapping of the pointer buttons. Elements of the map list are indexed starting from 1. The length of the
list nmap must be the same as XGetPointerMapping() returns (you must call that first). The index is a physical button number, and the ele-
ment of the list defines the effective button number. In other words, if map[2] is set to 1, when the second physical button is pressed, a
ButtonPress event will be generated if Button1Mask was selected but not if Button2Mask was selected. The button member in the event will
read Button1.
No two elements can have the same non-zero value (else a BadValue error). A value of zero for an element of map disables a button, and
values for elements are not restricted in value by the number of physical buttons. If any of the buttons to be altered are currently in
the down state, the returned value is MappingBusy and the mapping is not changed.
This function returns either MappingSuccess or MappingBusy. XSetPointerMapping() generates a MappingNotify event when it returns Mapping-
Success.
Errors
BadValue Two elements of map[] have same non-zero value.
nmap not equal to XGetPointerMapping() return value.
See Also
XChangeActivePointerGrab(), XChangePointerControl(), XGetPointerControl(), XGetPointerMapping(), XGrabPointer(), XQueryPointer(), XUngrab-
Pointer(), XWarpPointer().
Xlib - Pointer XSetPointerMapping()