Sponsored Content
Full Discussion: awk syntax help
Top Forums Shell Programming and Scripting awk syntax help Post 302353076 by streetfighter2 on Monday 14th of September 2009 12:32:19 PM
Old 09-14-2009
Quote:
Originally Posted by vgersh99
what does a sample output of 'nmap -sP failedhost.com' look like AND what part of it are you after?
nmap -sP asasdfasfasdfsaf.com | grep -i failed
Failed to resolve given hostname/IP: asasdfasfasdfsaf.com. Note that you can't use '/mask' AND '1-4,7,100-' style IP ranges
WARNING: No targets were specified, so 0 hosts scanned.

I want to get $6 or ' asasdfasfasdfsaf.com.'
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with Awk Syntax

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)
Discussion started by: pinnacle
4 Replies

2. Shell Programming and Scripting

AWK syntax

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)
Discussion started by: wakatana
4 Replies

3. UNIX for Dummies Questions & Answers

awk syntax

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)
Discussion started by: posix
1 Replies

4. Shell Programming and Scripting

AWK syntax help

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)
Discussion started by: usustarr
27 Replies

5. AIX

Help with syntax using AWK

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)
Discussion started by: ganesnar
7 Replies

6. Shell Programming and Scripting

awk syntax

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)
Discussion started by: zhshqzyc
3 Replies

7. Shell Programming and Scripting

AWK Function syntax

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)
Discussion started by: Godie
2 Replies

8. Shell Programming and Scripting

Syntax Problem with awk

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)
Discussion started by: rasingraj
5 Replies

9. Shell Programming and Scripting

Help with the awk syntax

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)
Discussion started by: juzz4fun
13 Replies

10. Shell Programming and Scripting

Awk: syntax error

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
XSetPointerMapping(3)						  XLIB FUNCTIONS					     XSetPointerMapping(3)

NAME
XSetPointerMapping, XGetPointerMapping - manipulate pointer settings SYNTAX
int XSetPointerMapping(Display *display, unsigned char map[], int nmap); int XGetPointerMapping(Display *display, unsigned char map_return[], int nmap); ARGUMENTS
display Specifies the connection to the X server. map Specifies the mapping list. map_return Returns the mapping list. nmap Specifies the number of items in the mapping list. DESCRIPTION
The XSetPointerMapping function sets the mapping of the pointer. If it succeeds, the X server generates a MappingNotify event, and XSet- PointerMapping returns MappingSuccess. Element map[i] defines the logical button number for the physical button i+1. The length of the list must be the same as XGetPointerMapping would return, or a BadValue error results. A zero element disables a button, and elements are not restricted in value by the number of physical buttons. However, no two elements can have the same nonzero value, or a BadValue error results. If any of the buttons to be altered are logically in the down state, XSetPointerMapping returns MappingBusy, and the mapping is not changed. XSetPointerMapping can generate a BadValue error. The XGetPointerMapping function returns the current mapping of the pointer. Pointer buttons are numbered starting from one. XGetPoint- erMapping returns the number of physical buttons actually on the pointer. The nominal mapping for a pointer is map[i]=i+1. The nmap argu- ment specifies the length of the array where the pointer mapping is returned, and only the first nmap elements are returned in map_return. DIAGNOSTICS
BadValue Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argu- ment, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. SEE ALSO
XChangeKeyboardControl(3), XChangeKeyboardMapping(3) Xlib - C Language X Interface X Version 11 libX11 1.6.0 XSetPointerMapping(3)
All times are GMT -4. The time now is 04:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy