From owner-freebsd-questions@FreeBSD.ORG Wed Mar 23 20:06:29 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 69532106564A for ; Wed, 23 Mar 2011 20:06:29 +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 3DD0A8FC0C for ; Wed, 23 Mar 2011 20:06:29 +0000 (UTC) Received: from server.cwis.biz (localhost [127.0.0.1]) by server.cwis.biz (Postfix) with ESMTP id 670092639A01; Wed, 23 Mar 2011 15:06:51 -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 WRKzH-jj8fQy; Wed, 23 Mar 2011 15:06:38 -0500 (CDT) Received: from [192.168.46.76] (unknown [64.122.64.171]) by server.cwis.biz (Postfix) with ESMTPSA id 9739E2639A00; Wed, 23 Mar 2011 15:06:38 -0500 (CDT) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Ryan Coleman In-Reply-To: <31D3BED1-7035-435F-B127-EFAAF6AFF076@mac.com> Date: Wed, 23 Mar 2011 15:06:14 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <20D9B390-3190-4865-A19E-BDEDC595E7A2@d3photography.com> References: <21012F71-5038-45F1-98C6-72A0B1239009@d3photography.com> <31D3BED1-7035-435F-B127-EFAAF6AFF076@mac.com> To: Chuck Swiger 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:06:29 -0000 We're close on this (thanks for the push). It wants to load the entire path up in ${DEST} which is not ideal but I = can live with that. 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 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. thanks! On Mar 23, 2011, at 2:11 PM, Chuck Swiger wrote: > Hi-- >=20 > On Mar 23, 2011, at 11:49 AM, Ryan Coleman wrote: >> Disc images are located in /mount/disc_images/ (all are ISOs) >> They need to mount into /mount/office_files/images/FILENAME [without = the .iso extension] >>=20 >> How can I do this? I've always been given these types of scripts in = the past at an old job but I don't have access to those examples = anymore. >=20 > Something like this might do (untested, though): >=20 > #! /bin/sh = =20 >=20 > for FILE in /mount/disc_images/*; do > DEST=3D$FILE:r > mount -t cd9660 /dev/`mdconfig -f ${FILE}` = /mount/office_files/images/${DEST} > done >=20 > Might need to add quotes if you have spaces or other unusual = characters in your ISO filenames.... >=20 > Regards, > --=20 > -Chuck >=20