From owner-freebsd-questions Fri Dec 11 11:45:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA18052 for freebsd-questions-outgoing; Fri, 11 Dec 1998 11:45:15 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from horton.iaces.com (horton.iaces.com [204.147.87.98]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA18038 for ; Fri, 11 Dec 1998 11:45:12 -0800 (PST) (envelope-from proot@horton.iaces.com) Received: (from proot@localhost) by horton.iaces.com (8.8.8/8.8.8) id NAA05626; Fri, 11 Dec 1998 13:44:54 -0600 (CST) (envelope-from proot) From: "Paul T. Root" Message-Id: <199812111944.NAA05626@horton.iaces.com> Subject: Re: Recursing directories? In-Reply-To: <3671754E.AC4F0F65@lundahl.com> from "James A. Taylor" at "Dec 11, 98 12:41:02 pm" To: jataylor@lundahl.com (James A. Taylor) Date: Fri, 11 Dec 1998 13:44:54 -0600 (CST) Cc: freebsd-questions@FreeBSD.ORG X-Organization: USWEST !nterprise Networking - ACES X-Phone: (612) 664-3385 X-Fax: (612) 664-4779 X-Page: (800) SKY-PAGE PIN: 537-7270 X-Address: 600 Stinson Blvd, Fl 1S X-Address: Minneapolis, MN 55413 X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In a previous message, James A. Taylor said: > I'm sure your all getting tired of hearing from me today. > > I wrote > > > > Is it possible to have a shell script recurse a directory tree? > > > Still the same situation as my last email I have a directory tree > > > with .shtml files. I want to recurse the directory tree renaming > > > each .shtml to a .html file. Paul sent me the following script that > > > allows me to mv all .shtml in a single directory: > > Dan Mahoney wrote: > > > How about: > > > > find . -type d -exec yourscript {} > > > > where {} gets filled in with the name of each directory that gets found. > > Casper wrote: > > > see man find > > u'll use something like this : > > > > find /dir_name/ -name *.shtml -e mv {} `basenahe {} .shtml`.html; > > When I run find with the -exec option I get the following error > > find: -exec: no terminating ";" > I have put a ; at the end put I still get the error. What am I doin wrong? You have to escape the ; so the shell doesn't take it and sends it to the find. find . -type d -exec script {} \; -- "Tomorrow doesn't matter, for I have lived today."--Horace (65-8 B.C.) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message