From owner-freebsd-questions Thu May 9 22:09:42 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id WAA02156 for questions-outgoing; Thu, 9 May 1996 22:09:42 -0700 (PDT) Received: from arnie.systems.sa.gov.au (arnie.systems.sa.gov.au [143.216.242.3]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id WAA01714 for ; Thu, 9 May 1996 22:05:16 -0700 (PDT) Received: from state.systems.sa.gov.au by arnie.systems.sa.gov.au (PMDF V4.3-7 #13538) id <01I4JLIM4NAO008WY1@arnie.systems.sa.gov.au>; Fri, 10 May 1996 14:33:44 +1030 Received: from dogbert.systems.sa.gov.au (dogbert.systems.sa.gov.au) by state.systems.sa.gov.au (PMDF V5.0-4 #13538) id <01I4JLI7YZZ4008R3T@state.systems.sa.gov.au> for questions@freefall.freebsd.org; Fri, 10 May 1996 14:33:23 +0930 Received: from jolt.systems.sa.gov.au (jolt.systems.sa.gov.au [143.216.237.8]) by dogbert.systems.sa.gov.au (8.6.12/8.6.12) with SMTP id OAA29532 for ; Fri, 10 May 1996 14:39:05 +0930 Date: Fri, 10 May 1996 14:16:23 +0930 From: Garth Kidd Subject: running gag: chmod -R .\* In-reply-to: owner-questions-digest@freefall.freebsd.org "questions-digest V1 #828" (May 9, 12:07) To: questions@freefall.freebsd.org Message-id: <960510143531.ZM2871@jolt.systems.sa.gov.au> MIME-version: 1.0 X-Mailer: Z-Mail 4.0 (4.0.0 Aug 21 1995) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT References: <199605091907.MAA04692@freefall.freebsd.org> Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >>>>> chmod 644 -R .??* >>>> I prefer chmod 644 -R .[a-zA-Z]* myself >>># chmod 644 -R .[^.]* * >>> >>>(csh at least) >> All shells, and no compilcated [] expresssions:- >> >> chmod 0644 -R `ls -A` >> does _exactly what's required. > Unless the argument list is too long. :-( > > ls -A | xargs chmod 0644 -R Aah, but what about .files in subdirectories? #!/bin/csh foreach a (`find . -type d -print`) cd $a chmod 0644 `/bin/ls -1Ad` end Note that find won't follow symlinked directories, which is probably a good thing. -- garth@dogbert.systems.sa.gov.au | Garth Kidd +61-8-207-7740 (voice) | Network Services Branch +61-8-207-7860 (fax) | Southern Systems | Adelaide, AUSTRALIA