Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'equivalent 1-liners' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
equivalent 1-liners
Authored by: mkhaw on Jan 29, '03 12:52:21PM

Some more directly 1-step alternatives:

1) (t)csh alias (typed all on one line):
alias whois "\whois -h "'`\whois \!:1 | sed -n '"s'/.*Whois Server: //p'"'` \!:1'

The funky mix of double- and single-quotes is to get around shell expansion and interpretation of special characters during the definition of the alias itself.

2) Equivalent /bin/sh 'mywhois' script:
#!/bin/sh
whois -h `whois $1 | sed -n 's/.*Whois Server: //p'` $1

3) Equivalent bash 'mywhois' shell function:
mywhois () {
whois -h `whois $1 | sed -n 's/.*Whois Server: //p'` $1
}

In (2) and (3) if you replace the 'whois' within the pipe with the full pathname of the real whois program (e.g., /usr/bin/whois) you can name the script/shell function itself 'whois'.



[ Reply to This | # ]