Sponsored Content
Full Discussion: How do I make a "keyword"?
Top Forums UNIX for Dummies Questions & Answers How do I make a "keyword"? Post 302477360 by ctsgnb on Saturday 4th of December 2010 03:48:42 PM
Old 12-04-2010
I am not sure to understand your question correcly but maybe you can try

Code:
#!/bin/bash
while read ip
do
     whois -r $ip >>output
done<$1

or if you want only one output per $ip scanned from the file passed in parameter :

Code:
#!/bin/bash
while read ip
do
     whois -r $ip >>output"$ip"
done<$1

---------- Post updated at 09:48 PM ---------- Previous update was at 09:15 PM ----------

Just for your information

Here is the code :
Code:
$ cat demo
echo "arg1=$1 arg2=$2 arg3=$3 arg4=$4 Total_Number_Of_Arguments=$#"
echo "@=$@"
echo "*=$*"
shift 1
echo "arg1=$1 arg2=$2 arg3=$3 arg4=$4 Total_Number_Of_Arguments=$#"
shift 2
echo "arg1=$1 arg2=$2 arg3=$3 arg4=$4 Total_Number_Of_Arguments=$#"

Here is the result of the run :
Code:
$ ksh demo For Education "pur\tpose" Only
arg1=For arg2=Education arg3=pur        pose arg4=Only Total_Number_Of_Arguments=4
@=For Education pur     pose Only
*=For Education pur     pose Only
arg1=Education arg2=pur pose arg3=Only arg4= Total_Number_Of_Arguments=3
arg1=Only arg2= arg3= arg4= Total_Number_Of_Arguments=1

This User Gave Thanks to ctsgnb For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

"./cofigure" and "make" turmoil

I am a Unix newbie and I downloaded some X11 programs. I have gcc, but I cannot compile the files. I NEED HELP!!!! :confused: (16 Replies)
Discussion started by: gnerd
16 Replies

2. Programming

how could i make a program mixed with many "|", "<" and ">"

I have written following code to do: ls -l | wc -w, it works: but when there are not only a single "|", if there are more such as: ls -l | sort -r | sort | sort -r, This program does not work, i want to know how could i deal with it when there are more "|", another situation is that, if it mixes... (2 Replies)
Discussion started by: strugglingman
2 Replies

3. UNIX for Dummies Questions & Answers

grep/cat/more -- search in a txt file and display content from a specific "keyword"

Hi, I have a .txt file Sample: ===================== NEXT HOST ===================== AEADBAS001 ip access-list extended BLA_Incoming_Filter ip access-list extended BLA_Outgoing_Filter access-list 1 permit xxxxxxxxxxxxxx access-list 2 permit xxxxxxxxxxxxxx =====================... (4 Replies)
Discussion started by: I-1
4 Replies

4. Shell Programming and Scripting

Need some help deleting words from a line which are not my "Keyword"

Hi, i'm currently new to scripting and need some help with my problem, so i'll jump right to it. I have a file containing text, the file is pretty big so for the sake of this i'll just say this is the text: John id number is abc34938 Grahams id number is pending id number abc64334 is Bob's ... (14 Replies)
Discussion started by: linuxkid
14 Replies

5. Shell Programming and Scripting

Make scipt except from "Y","y" and "yes" to take [Enter] as being "yes"

This is the script: #!/bin/sh if ; then rm -rf /usr/share/WallpaperChanger; fi if ; then rm -rf /usr/bin/wallch; fi; if ; then rm -rf /usr/share/applications/wallch.desktop; fi if ; then rm -rf /usr/share/doc/wallch; fi if ; then rm -rf /usr/share/man/man1/wallch.1.gz; fi echo "Delete... (4 Replies)
Discussion started by: hakermania
4 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

Error for "continue" keyword in Linux script.

Hi All I have a function in a linux script like this clean_up() { db2 -x "UPDATE ${DB_SCHEMA_NAME}.ETL_DAILY SET ETL_STATUS = 'SUCCESSFUL' WHERE PROCESS_DATE = '${INT_RUN_DATE}' AND BATCH_NO = ${CM_BATCH} AND APP_ID = ${APP_ID} AND APP_VERSION = '${APP_VERSION}'" > ${TMPOUT} ... (3 Replies)
Discussion started by: vee_789
3 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

10. UNIX for Beginners Questions & Answers

How to print the "grep" result as specified keyword order?

I have a content.xls file as given below, NC_020815.1 1891831 1894692 virb4_A0A0H2X8Z4_ 1 954 1945 NC_020815.1 1883937 1886123 vird4_A0A0P9KA26_ 1 729 1379 NC_020815.1 2976151 2974985 virb10_H8FLU5_Ba 1 393 478 NC_020815.1 2968797 2967745 virb6_A0A0Q5GCZ4 5 398 499... (2 Replies)
Discussion started by: dineshkumarsrk
2 Replies
WHOIS(1)						    BSD General Commands Manual 						  WHOIS(1)

NAME
whois -- Internet domain name and network number directory service SYNOPSIS
whois [-aAbfgiIklmPQrRS] [-c TLD | -h host] [-p port] [--] name ... DESCRIPTION
The whois utility looks up records in the databases maintained by several Network Information Centers (NICs). By default whois starts by querying the Internet Assigned Numbers Authority (IANA) whois server, and follows referrals to whois servers that have more specific details about the query name. The IANA whois server knows about IP address and AS numbers as well as domain names. There are a few special cases where referrals do not work, so whois goes directly to the appropriate server. These include point-of-contact handles for ARIN, nic.at, NORID, and RIPE, and domain names under ac.uk. The options are as follows: -a Use the American Registry for Internet Numbers (ARIN) database. It contains network numbers used in those parts of the world covered neither by APNIC, AfriNIC, LACNIC, nor by RIPE. The query syntax is documented at https://www.arin.net/resources/whoisrws/whois_api.html#nicname -A Use the Asia/Pacific Network Information Center (APNIC) database. It contains network numbers used in East Asia, Australia, New Zea- land, and the Pacific islands. Get query syntax documentation using whois -A help -b Use the Network Abuse Clearinghouse database. It contains addresses to which network abuse should be reported, indexed by domain name. -c TLD This is the equivalent of using the -h option with an argument of "TLD.whois-servers.net". This can be helpful for locating country- class TLD whois servers. -f Use the African Network Information Centre (AfriNIC) database. It contains network numbers used in Africa and the islands of the western Indian Ocean. Get query syntax documentation using whois -f help -g Use the US non-military federal government database, which contains points of contact for subdomains of .GOV. -h host Use the specified host instead of the default. Either a host name or an IP address may be specified. -i Use the traditional Network Information Center (InterNIC) (whois.internic.net) database. This now contains only registrations for domain names under .COM, .NET, .EDU. You can specify the type of object to search for like whois -i 'type name' where type can be domain, nameserver, registrar. The name can contain * wildcards. -I Use the Internet Assigned Numbers Authority (IANA) database. -k Use the National Internet Development Agency of Korea's (KRNIC) database. It contains network numbers and domain contact information for Korea. -l Use the Latin American and Caribbean IP address Regional Registry (LACNIC) database. It contains network numbers used in much of Latin America and the Caribbean. -m Use the Route Arbiter Database (RADB) database. It contains route policy specifications for a large number of operators' networks. -p port Connect to the whois server on port. If this option is not specified, whois defaults to port 43. -P Use the PeeringDB database of AS numbers. It contains details about presence at internet peering points for many network operators. -Q Do a quick lookup; whois will not attempt to follow referrals to other whois servers. This is the default if a server is explicitly specified using one of the other options or in an environment variable. See also the -R option. -r Use the R'eseaux IP Europ'eens (RIPE) database. It contains network numbers and domain contact information for Europe. Get query syntax documentation using whois -r help -R Do a recursive lookup; whois will attempt to follow referrals to other whois servers. This is the default if no server is explicitly specified. See also the -Q option. -S By default whois adjusts simple queries (without spaces) to produce more useful output from certain whois servers, and it suppresses some uninformative output. With the -S option, whois sends the query and prints the output verbatim. The operands specified to whois are treated independently and may be used as queries on different whois servers. ENVIRONMENT
WHOIS_SERVER The primary default whois server. If this is unset, whois uses the RA_SERVER environment variable. RA_SERVER The secondary default whois server. If this is unset, whois will use whois.iana.org. EXIT STATUS
The whois utility exits 0 on success, and >0 if an error occurs. EXAMPLES
To obtain contact information about an administrator located in the Russian TLD domain "RU", use the -c option as shown in the following example, where CONTACT-ID is substituted with the actual contact identifier. whois -c RU CONTACT-ID (Note: This example is specific to the TLD "RU", but other TLDs can be queried by using a similar syntax.) The following example demonstrates how to query a whois server using a non-standard port, where ``query-data'' is the query to be sent to ``whois.example.com'' on port ``rwhois'' (written numerically as 4321). whois -h whois.example.com -p rwhois query-data Some whois servers support complex queries with dash-letter options. You can use the -- option to separate whois command options from whois server query options. A query containing spaces must be quoted as one argument to the whois command. The following example asks the RIPE whois server to return a brief description of its ``domain'' object type: whois -r -- '-t domain' SEE ALSO
Ken Harrenstien and Vic White, NICNAME/WHOIS, 1 March 1982, RFC 812. HISTORY
The whois command appeared in 4.3BSD. BSD
April 25, 2016 BSD
All times are GMT -4. The time now is 07:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy