[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: read 1 var in when executing command
From: |
Chris F.A. Johnson |
Subject: |
Re: read 1 var in when executing command |
Date: |
Sat, 12 May 2007 23:00:40 -0400 |
User-agent: |
slrn/0.9.8.1 (Linux) |
On 2007-05-12, jdh239 wrote:
>
> I saw something similar to this in the archives already, but didn't see a
> real answer. I am modifying my 'whois' command to just grep for the
> expiration date of my domains:
>
> ie jwhois
>
> whois $DOM | grep -i expi | grep -i -e jan -e feb -e mar -e apr -e may -e
> jun -e jul -e aug -e sep -e oct -e nov -e dec | grep -i -v date
>
> What I would like is to pass in the parameter in the commandline: jwhois
><domain>
>
> Currently I have:
> echo -n "Enter the domain name: "
> read DOM
>
> I would prefer, again, just to execute the command with the domain name
> following.... Not sure how to do it. I have been looking around and saw
> things like getopts, but I am only passing in one variable and thought it
> should be fairly simple
whois "$1" | grep ...
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
===================================================================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)