Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jul 2002 19:35:16 +0200
From:      Nils Vogels <nivofreebsd-questions@yuckfou.org>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Shell Script gurus??
Message-ID:  <20020704173516.GI69958@amor.yuckfou.org>
In-Reply-To: <20020704172903.GF56027@ns2.wananchi.com>
References:  <20020704172903.GF56027@ns2.wananchi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 04, 2002 at 08:29:03PM +0300, Odhiambo Washington wrote:

<snip mysql>

> Now in my script I am reading the domain name from stdin (??
> 
> 	echo Entering domain name in MySQL DB:
>         echo ""
>         domain_name=
>         echo -n Please supply the domain name to activate:
>         read domain_name
> 
> 
> The domain name can be domain.com or the domain.co.ke but I am interested
> in the part before the first (.) so that I can manipulate some parameter
> with it.

man cut
man awk

should help you.

One example could be:

$mydomain=`echo $domain_name|awk -F\. ' { print $1 } '`   (this is untested)

HTH

-- 
Nils Vogels		PGP:0xC26BD15F Available on keyservers.
S@H:4988WU/6.761yr	--> setiathome.ssl.berkeley.edu. Will you find aliens?

My other computer is your windows box.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020704173516.GI69958>