MACSCRPT Archives

September 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Mark J. Reed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 3 Sep 2009 19:16:58 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (34 lines)
Well, I wouldn't use "ls -l | grep" to search for files with a given
mode; ls -l output is tricky to parse programmatically.

I would use find... Something like

find * -type d -prune -mode 0755 -print0 | xargs -0 chmod 0775



On 9/3/09, jeff donovan <[log in to unmask]> wrote:
> greetings
>
> I'm a little rusty,
> I want to search a directory for a changed permission field and reset
> it.
>
> example
>
> ls -la | grep drwxr-xr-x +
>
> (chop the other info) "leave_the_fileDir"
> chmod 775 $the_fileDir
>
>
> it's the chop the other info I forget how to do. anyone have any
> snipit's ?
> -j
>

-- 
Sent from my mobile device

Mark J. Reed <[log in to unmask]>

ATOM RSS1 RSS2