From owner-freebsd-questions Wed Aug 22 7:14:31 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mip.co.za (puck.mip.co.za [209.212.106.44]) by hub.freebsd.org (Postfix) with ESMTP id 2977737B40E for ; Wed, 22 Aug 2001 07:13:58 -0700 (PDT) (envelope-from patrick@mip.co.za) Received: from patrick (patrick.mip.co.za [10.3.13.181]) by mip.co.za (8.9.3/8.9.3) with SMTP id QAA20144 for ; Wed, 22 Aug 2001 16:13:55 +0200 (SAST) (envelope-from patrick@mip.co.za) From: "Patrick O'Reilly" To: "FBSD-Q" Subject: RE: One for the script gurus Date: Wed, 22 Aug 2001 16:15:33 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal In-Reply-To: <20010822163649.B98728@ns2.wananchi.com> 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 Wash, try this for a start: ------- for usr in `grep -v "^#" /etc/passwd | cut -d":" -f1` do mkdir /home/${usr} # replace /home/ with whatever base you want chown ${usr} /home/${usr} done ------- This does not take care of group ownership of the directories, but it does exclude comment lines in passwd from being processed. Patrick. -----Original Message----- From: owner-freebsd-questions@FreeBSD.ORG [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Odhiambo Washington Sent: 22 August 2001 15:37 To: FBSD-Q Subject: One for the script gurus You have your /etc/passwd file and from it you want to create a home directory for every user in it. I am imagining how to extract that info from the file and use it to feed some script that would do what I want. I am imagining some emergency situation where my /home tape backup has goofed. I leave it you to, please. Thanks. -Wash -- Odhiambo Washington Wananchi Online Ltd., wash@wananchi.com 1st Flr Loita Hse. Tel: 254 2 313985 Loita Street., Fax: 254 2 313922 PO Box 10286,00100-NAIROBI,KE. In case of doubt, make it sound convincing. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message