From owner-freebsd-questions@FreeBSD.ORG Wed Mar 23 20:22:15 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6794106566C for ; Wed, 23 Mar 2011 20:22:15 +0000 (UTC) (envelope-from editor@d3photography.com) Received: from server.cwis.biz (70-89-202-5-invergrove-mn.hfc.comcastbusiness.net [70.89.202.5]) by mx1.freebsd.org (Postfix) with ESMTP id 7A89C8FC0C for ; Wed, 23 Mar 2011 20:22:15 +0000 (UTC) Received: from server.cwis.biz (localhost [127.0.0.1]) by server.cwis.biz (Postfix) with ESMTP id 934562639A07; Wed, 23 Mar 2011 15:22:37 -0500 (CDT) X-Virus-Scanned: amavisd-new at cwis.biz Received: from server.cwis.biz ([127.0.0.1]) by server.cwis.biz (server.cwis.biz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PDF4ZyxGjNCa; Wed, 23 Mar 2011 15:22:24 -0500 (CDT) Received: from [192.168.46.76] (unknown [64.122.64.171]) by server.cwis.biz (Postfix) with ESMTPSA id A44DC2639A06; Wed, 23 Mar 2011 15:22:24 -0500 (CDT) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Ryan Coleman In-Reply-To: <20110323211605.4c893e70.freebsd@edvax.de> Date: Wed, 23 Mar 2011 15:22:00 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <6E177CD7-7FA1-4A1C-ADBD-13F85A8049A1@d3photography.com> References: <21012F71-5038-45F1-98C6-72A0B1239009@d3photography.com> <31D3BED1-7035-435F-B127-EFAAF6AFF076@mac.com> <20D9B390-3190-4865-A19E-BDEDC595E7A2@d3photography.com> <20110323211605.4c893e70.freebsd@edvax.de> To: Polytropon X-Mailer: Apple Mail (2.1082) Cc: FreeBSD Mailing List Subject: Re: Automating mounting of ISO images X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2011 20:22:15 -0000 On Mar 23, 2011, at 3:16 PM, Polytropon wrote: > On Wed, 23 Mar 2011 15:06:14 -0500, Ryan Coleman = wrote: >> I am also trying to make the directories right before the attempt >> to mount the image (a 'duh' moment just now).=20 >> So I'd like to have just the filename, not the full path, made >> as a folder...=20 >=20 > A directory. :-) Thank you. :-) slip of the fingers... >=20 >=20 >> In other news: The ISOs are all made by me, so no special chars, >> just capital and lowercase letters, sometimes numbers, no spaces >> and use of underscores and hyphens. >=20 > Underscores and hypens are traditionally not a problem. Spaces > can be and need extra attention. But as you're using PROPER > filenames, it should be easy to get the target directory name > from the ISO filename. >=20 > The unelegant way is to use basename: >=20 > DIRNAME=3D`basename ${FILE} .iso` >=20 > Of course, there's a sh builtin for the same purpose: >=20 > DIRNAME=3D${FILE%.iso} >=20 > Adding this to the iteration list, you can easily create > the directories needed prior to the mount attempt. I'll give this a whirl in a bit.