Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with 1 line shell script, help with %1 1

Status
Not open for further replies.

farley99

MIS
Feb 12, 2003
413
US
#!/bin/bash
echo `whois %1 -hwhois.opensrs.net`;

When I run
whois farley.com
It tells me
No match for %1

How do I fix that?
 
Your script is called whois ?
The same name as the whois in /bin ?


Dickie Bird (:)-)))
 
well spotted! It appears to be running the one in the current dir first, but once the problem is fixed it'll loop like crazy!

farley, change the name before you do anything else

Scotty
 
> well spotted! It appears to be running the one in the current dir first
If this is so, I'd also be concerned about the apparent presence of
Code:
"."
in the search PATH.

This is a security risk which can cause you to run programs you didn't expect.

--
 
i changed it to wh
same error when I do
./wh farley.com
 
Farley,

change the %1 to $1

%1 is the syntax windows uses for arguments - unix uses $1, $2 etc. or $* for all arguments

Scotty
 
Thanks!!

It doesnt get the line breaks though....
./wh farley.org

Any tips on this?
NOTICE: Access to .ORG WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the PIR registry database. The data in this record is provided by Public Interest Registry for informational purposes only, and PIR does not guarantee its accuracy. This service is intended only for query-based access. You agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to: (a) allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the data recipient's own existing customers; or (b) enable high volume, automated, electronic processes that send queries or data to the systems of Registry Operator or any ICANN-Accredited Registrar, except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. PIR reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy. Domain ID:D515620-LROR Domain Name:FARLEY.ORG Created On:31-Aug-1997 04:00:00 UTC Last Updated On:01-Aug-2003 03:13:11 UTC Expiration Date:30-Aug-2004 04:00:00 UTC Sponsoring Registrar:R42-LROR Status:OK Registrant ID:42-C Registrant Name:SEE SPONSORING REGISTRAR Registrant Street1:Whois Server:whois.gandi.net Registrant Street2:Referral URL: Registrant City:N/A Registrant Postal Code:N/A Registrant Country:CA Registrant Email:not@available.org Admin ID:42-C Admin Name:SEE SPONSORING REGISTRAR Admin Street1:Whois Server:whois.gandi.net Admin Street2:Referral URL: Admin City:N/A Admin Postal Code:N/A Admin Country:CA Admin Email:not@available.org Billing ID:42-C Billing Name:SEE SPONSORING REGISTRAR Billing Street1:Whois Server:whois.gandi.net Billing Street2:Referral URL: Billing City:N/A Billing Postal Code:N/A Billing Country:CA Billing Email:not@available.org Tech ID:42-C Tech Name:SEE SPONSORING REGISTRAR Tech Street1:Whois Server:whois.gandi.net Tech Street2:Referral URL: Tech City:N/A Tech Postal Code:N/A Tech Country:CA Tech Email:not@available.org Name Server:NS1.GRANITECANYON.COM Name Server:NS1.SECONDARY.COM Name Server:NS2.SECONDARY.COM Name Server:HARVEY.FARLEY.ORG ==================================================== % GANDI Registrar whois database for .COM, .NET, .ORG. % % Access and use restricted pursuant to French law on personal data. % Copy of whole or part of the data without permission from GANDI % is strictly forbidden. % The sole owner of a domain is the entity described in the relevant % 'domain:' record. % Domain ownership disputes should be settled using ICANN's Uniform Dispute % Resolution Policy: % % Acces et utilisation soumis a la legislation francaise sur % les donnees personnelles. % Copie de tout ou partie de la base interdite sans autorisation de GANDI. % Le possesseur d'un domaine est l'entite decrite dans % l'enregistrement 'domain:' correspondant. % Un desaccord sur la possession d'un nom de domaine peut etre resolu % en suivant la Uniform Dispute Resolution Policy de l'ICANN: % % % Date: 2003/09/24 20:16:17 domain: FARLEY.ORG owner-address: Sean Farley owner-address: 2104 Bent Tree Court owner-address: 78681 owner-address: Round Rock owner-address: Texas owner-address: United States of America admin-c: SF97-GANDI tech-c: SF97-GANDI bill-c: SF97-GANDI nserver: harvey.farley.org 209.198.147.114 nserver: ns1.secondary.com 198.133.199.3 nserver: ns2.secondary.com 198.133.199.4 nserver: ns1.granitecanyon.com 205.166.226.38 reg_created: 1997-08-31 00:00:00 expires: 2004-08-30 04:00:00 created: 2000-08-23 00:59:15 changed: 2003-08-01 05:13:12 person: Sean Farley nic-hdl: SF97-GANDI address: 2104 Bent Tree Court address: 78681 address: Round Rock address: Texas address: United States of America phone: (512)246-2515 e-mail: root@farley.org lastupdated: 2003-09-23 16:49:09 This information was obtained from a different registrar, so we cannot verify its authenticity.
 
ditch the echo bit - it's not really necessary, the whois will still output to stdout.

so it'll just be:

#!/bin/bash
whois $1 -hwhois.opensrs.net

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top