When I encase that in a print system([that string]) line, I get the following:
Code:
./convert: line 59: syntax error near unexpected token `('
./convert: line 59: ` {print system("dig +short +ignore +nonssearch +noauthority +noadditional -4 %s A | awk '{for (k=1;k<=NF;k++) {if ($k ~ /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/) {printf $k ","}}}'" $(i+1));}'
I tried escaping the apostrophes (backticks produced even more errors) and that didn't help either.
Take pity on me. I'm a router / switch / firewall guy who is having to write scripts to translate from Symantec SGS to Cisco. I speak Cisco. I'm brand new to scripting.
I am writing a shell script.
Now i need to read in a string and send it to an awk file to compare and search for compatible record.
I wrote it like tat:
read serial | awk -f generate.awk data.dat
p/s: the data file got 6 field.
According to an expert, we can write it like tat:
read... (1 Reply)
Hi,
this is my test file :
DELETE FROM TABLE
WHERE ID_INTERNAL = :TABLE.ID-INTERNAL, ID-INTERNAL-CRAZY
ID-INTERNAL-OPEN
ID-INTERNAL
/ID-INTERNAL/
I want all occurences of ID-INTERNAL replaced with a one, if ID-INTERNAL has and dash afer it , dont replace it example:... (6 Replies)
i'm trying to pass a numerical argument with function xyz to print specfic lines of filename, but my 'awk' syntax is incorrect.
ie
xyx 3 (prints the 3rd line, separated by ':' of filename)
function xyz() {
arg1=$1
cat filename | awk -F: -v x=$arg1 '{print $x}'
}
any ideas? (4 Replies)
Hi,
Can any one tell me how to use the fourth argument of select system call.I saw example "port forwarding" on the net,but it was too complex for me to understand.Can any one explain me about the usage of exceptfds argument of select system call with simple example.
Thanks. (2 Replies)
Hi all
I have got a file digits.data containing the following data
1 3 4
2 4 9
7 3 1
7 3 10
I am writing a script that will pass an argument from C-shell to nawk command. But it seems the values in the nawk comman does not get set. the program does not print no values out. Here is the... (1 Reply)
I'm trying to figure out what's getting passed as the argument when I try to pass a directory as an argument, and I'm getting incredibly strange behavior. For example, from the command line I'm typing:
nawk -f ./test.awk ~
test.awk contains the following:
{
directory = $NF
print... (13 Replies)
I have one working awk command line. Which taking data from the “J1202523.TXT” file and generating the “brazil.dat” file. PFB code.
awk '{ DUNS = substr($0,0,9);if ( substr($0,14,3) == "089" ) print DUNS }' J1202523.TXT > Brazil.dat
But now I want to pass two parameter as a command line argument... (4 Replies)
I have the awk script below and things go wrong when I do
awk -v dsrmx=25 -f ./checkSRDry.awk --usage
I basically want to override the usual --usage and --help that awk gives.
How do people usually handle this situation when you also want to supply your own usage and help
concerning the... (2 Replies)
hi,
I want to implement some function to perform following task
if ; then
$TEXT = "Data_0"
else
$TEXT = $1
fi
if ; then
$Lines = 45
else
$Lines = $2
fi
Kindly suggest,
thanks (11 Replies)
consider the script below
sh /opt/hqe/hqapi1-client-5.0.0/bin/hqapi.sh alert list --host=localhost --port=7443 --user=hqadmin --password=hqadmin --secure=true >/tmp/alerts.xml
awk -F'' '{for(i=1;i<=NF;i++){
if($i=="Alert id") {
if(id!="")
if(dt!=""){
cmd="sh someScript.sh... (2 Replies)
Discussion started by: vivek d r
2 Replies
LEARN ABOUT FREEBSD
hosts
HOSTS(5) BSD File Formats Manual HOSTS(5)NAME
hosts -- host name data base
DESCRIPTION
The hosts file contains information regarding the known hosts on the network. It can be used in conjunction with DNS, and the NIS maps
`hosts.byaddr' and `hosts.byname', as controlled by nsswitch.conf(5). For each host a single line should be present with the following
information:
Internet address
official host name
aliases
Items are separated by any number of blanks and/or tab characters. A ``#'' indicates the beginning of a comment; characters up to the end of
the line are not interpreted by routines which search the file.
This file provides a backup used when the name server is not running. For the name server, it is suggested that only a few addresses be
included in this file. These include addresses for the local interfaces that ifconfig(8) needs at boot time and a few machines on the local
network.
This file may be created from the official host data base maintained at the Network Information Control Center (NIC), though local changes
may be required to bring it up to date regarding unofficial aliases and/or unknown hosts. As the data base maintained at NIC is incomplete,
use of the name server is recommended for sites on the DARPA Internet.
Network addresses are specified in the conventional ``.'' (dot) notation using the inet_addr(3) routine from the Internet address manipula-
tion library, inet(3). Host names may contain any printable character other than a field delimiter, newline, or comment character.
FILES
/etc/hosts The hosts file resides in /etc.
SEE ALSO gethostbyname(3), nsswitch.conf(5), ifconfig(8)
Name Server Operations Guide for BIND.
HISTORY
The hosts file format appeared in 4.2BSD.
BSD December 25, 2013 BSD