From owner-freebsd-questions@FreeBSD.ORG Wed Mar 23 20:16:07 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 D812B106566B for ; Wed, 23 Mar 2011 20:16:07 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 98CA78FC0C for ; Wed, 23 Mar 2011 20:16:07 +0000 (UTC) Received: from r55.edvax.de (port-92-195-86-215.dynamic.qsc.de [92.195.86.215]) by mx01.qsc.de (Postfix) with ESMTP id D6CB23CC7C; Wed, 23 Mar 2011 21:16:05 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id p2NKG59f001820; Wed, 23 Mar 2011 21:16:05 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Wed, 23 Mar 2011 21:16:05 +0100 From: Polytropon To: Ryan Coleman Message-Id: <20110323211605.4c893e70.freebsd@edvax.de> In-Reply-To: <20D9B390-3190-4865-A19E-BDEDC595E7A2@d3photography.com> References: <21012F71-5038-45F1-98C6-72A0B1239009@d3photography.com> <31D3BED1-7035-435F-B127-EFAAF6AFF076@mac.com> <20D9B390-3190-4865-A19E-BDEDC595E7A2@d3photography.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2011 20:16:07 -0000 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). > So I'd like to have just the filename, not the full path, made > as a folder... A directory. :-) > 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. 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. The unelegant way is to use basename: DIRNAME=`basename ${FILE} .iso` Of course, there's a sh builtin for the same purpose: DIRNAME=${FILE%.iso} Adding this to the iteration list, you can easily create the directories needed prior to the mount attempt. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...