From owner-freebsd-questions Thu Jul 4 10:30:36 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 A9A1137B400 for ; Thu, 4 Jul 2002 10:30:32 -0700 (PDT) Received: from ns2.wananchi.com (ns2.wananchi.com [62.8.64.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF51143E3B for ; Thu, 4 Jul 2002 10:30:30 -0700 (PDT) (envelope-from wash@wananchi.com) Received: from wash by ns2.wananchi.com with local (Exim 3.36 #1 (FreeBSD)) id 17QAPf-000Juc-00 for ; Thu, 04 Jul 2002 20:29:03 +0300 Date: Thu, 4 Jul 2002 20:29:03 +0300 From: Odhiambo Washington To: freebsd-questions@FreeBSD.ORG Subject: Shell Script gurus?? Message-ID: <20020704172903.GF56027@ns2.wananchi.com> Mail-Followup-To: Odhiambo Washington , freebsd-questions@FreeBSD.ORG Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Disclaimer: Any views expressed in this message,where not explicitly attributed otherwise, are mine alone!. X-Fortune: Eternal nothingness is fine if you happen to be dressed for it. -- Woody Allen X-Operating-System: FreeBSD 4.5-STABLE i386 X-Best-Window-Manager: Blackbox X-Designation: Systems Administrator, Wananchi Online Ltd. X-Location: Nairobi, KE, East Africa. X-Uptime: 8:22PM up 31 days, 11:06, 2 users, load averages: 0.26, 0.31, 0.31 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 I am writing a small shell cript to help me in managing virtual domains. After I register a new domain, I have to enter the following details about it in a MySQL database: domain name domain passwd max popboxes default forwarder (those who have used vmail-sql know about this) 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. How do I get that alone in a shell after I've read the domain name into a variable?? Trying to invent the wheel here, I am sure, with the things I wanna do ;) Thanks -Wash -- Odhiambo Washington "The box said 'Requires Wananchi Online Ltd. www.wananchi.com Windows 95, NT, or better,' Tel: 254 2 313985-9 Fax: 254 2 313922 so I installed FreeBSD." GSM: 254 72 743 223 GSM: 254 733 744 121 This sig is McQ! :-) Iron Law of Distribution: Them that has, gets. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message