From owner-freebsd-questions Thu Jul 4 10:35:21 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F6FC37B400 for ; Thu, 4 Jul 2002 10:35:17 -0700 (PDT) Received: from amor.yuckfou.org (f40079.upc-f.chello.nl [80.56.40.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1803143E09 for ; Thu, 4 Jul 2002 10:35:16 -0700 (PDT) (envelope-from nivofreebsd-questions@yuckfou.org) Received: by amor.yuckfou.org (Yuckfou Networks, from userid 500) id B91CBBA13; Thu, 4 Jul 2002 19:35:16 +0200 (CEST) Date: Thu, 4 Jul 2002 19:35:16 +0200 From: Nils Vogels To: freebsd-questions@FreeBSD.ORG Subject: Re: Shell Script gurus?? Message-ID: <20020704173516.GI69958@amor.yuckfou.org> Mail-Followup-To: freebsd-questions@FreeBSD.ORG References: <20020704172903.GF56027@ns2.wananchi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020704172903.GF56027@ns2.wananchi.com> User-Agent: Mutt/1.4i Organization: Yuckfou Networks -- Internet with a smile! X-OS: FreeBSD 4.6-STABLE X-PGP-key: finger://nivo.pgpkey@yuckfou.org X-PGP-Fingerprint: B43C 1EFB 1DD3 4D7E 7D49 8036 401F BE41 C26B D15F X-Echelon-trap: Arafat, bomb, hezbollah, terrorist, gun, FBI, CIA, FCC, murder, kill X-Omnicode-URL: http://www.gadgeteer.net/omnicode X-Omnicode-Version: 0.1.6 X-Omnicode: sxy cm196 kg105 skead5c9.bf824b_in_summer ha603e18 ey6195b5 es+ sp= Ag1976.Fall anE.West hdn LoNL ZoB.early&D rl? LANL(9).native&EN(8)^(9)&DE(5)&FR(6)&LA(3).rusty Crc(7)^(9)&?.wish Edc(7) HbTV.SF&Film.SF&Action Pl{L} MvB&H&W Kd! MBINFJ FHS UFPitr.bofh IN12 Ad* X-Stardate: [-30]8713.65 X-Uptime: 7:34PM up 17 days, 6:41, 6 users, load averages: 1.04, 1.04, 1.06 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jul 04, 2002 at 08:29:03PM +0300, Odhiambo Washington wrote: > 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