From owner-freebsd-questions@FreeBSD.ORG Fri Mar 26 15:49:11 2010 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 A84A1106564A for ; Fri, 26 Mar 2010 15:49:11 +0000 (UTC) (envelope-from corky1951@comcast.net) Received: from qmta06.emeryville.ca.mail.comcast.net (qmta06.emeryville.ca.mail.comcast.net [76.96.30.56]) by mx1.freebsd.org (Postfix) with ESMTP id 7E4468FC1C for ; Fri, 26 Mar 2010 15:49:11 +0000 (UTC) Received: from omta23.emeryville.ca.mail.comcast.net ([76.96.30.90]) by qmta06.emeryville.ca.mail.comcast.net with comcast id xqwY1d0021wfjNsA6rpBNe; Fri, 26 Mar 2010 15:49:11 +0000 Received: from comcast.net ([98.203.142.76]) by omta23.emeryville.ca.mail.comcast.net with comcast id xrp91d00t1f6R9u8jrpAE8; Fri, 26 Mar 2010 15:49:11 +0000 Received: by comcast.net (sSMTP sendmail emulation); Fri, 26 Mar 2010 08:49:08 -0700 Date: Fri, 26 Mar 2010 08:49:08 -0700 From: Charlie Kester To: freebsd-questions@freebsd.org Message-ID: <20100326154907.GC84718@comcast.net> Mail-Followup-To: freebsd-questions@freebsd.org References: <20100326071248.4ec4ea5e@scorpio.seibercom.net> <20100326113258.GA9957@catflap.slightlystrange.org> <20100326074456.7139c3da@scorpio.seibercom.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20100326074456.7139c3da@scorpio.seibercom.net> X-Mailer: Mutt 1.5.20 X-Composer: VIM 7.2 User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: Creating multiple directories simultaneously 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: Fri, 26 Mar 2010 15:49:11 -0000 On Fri 26 Mar 2010 at 04:44:56 PDT Jerry wrote: >On Fri, 26 Mar 2010 11:32:58 +0000, Daniel Bye > articulated: > >> On Fri, Mar 26, 2010 at 07:12:48AM -0400, Jerry wrote: >> > I could have sworn that I saw a method of creating several >> > directories, actually a parent direct and several sub-directories >> > simultaneously; however, I cannot fine the documentation any longer. >> > >> > Assume I want to create a directory: FOO with three directories >> > under it, foo-1, foo-2 and foo-3. I tried: mkdir -p foo {foo-1, >> > foo-2, foo-3} >> >> Almost. >> >> $ mkdir -p FOO/{foo-1,foo-2,foo-3} > >Thank you; that is exactly what I was looking for. I knew I had seen it >somewhere before. Or, for even less typing: $ mkdir -p FOO/foo-{1,2,3} Understand how this works, however, so you won't need to look it up again, but can apply it yourself in whatever variation is needed. It's called brace expansion. Here's the first hit that comes up in Google, which describes it fairly well: http://snap.nlc.dcccd.edu/reference/bash1/features_11.html This page is about the bash shell, but brace expansion works the same way in tcsh. It is NOT supported in tne Bourne shell.