Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Mar 2011 15:22:00 -0500
From:      Ryan Coleman <editor@d3photography.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: Automating mounting of ISO images
Message-ID:  <6E177CD7-7FA1-4A1C-ADBD-13F85A8049A1@d3photography.com>
In-Reply-To: <20110323211605.4c893e70.freebsd@edvax.de>
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>

next in thread | previous in thread | raw e-mail | index | archive | help


On Mar 23, 2011, at 3:16 PM, Polytropon wrote:

> On Wed, 23 Mar 2011 15:06:14 -0500, Ryan Coleman =
<editor@d3photography.com> 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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6E177CD7-7FA1-4A1C-ADBD-13F85A8049A1>