1752589 Members
4253 Online
108788 Solutions
New Discussion юеВ

Re: setcl

 
SOLVED
Go to solution
himacs
Super Advisor

setcl

Hi admins,

i am giving setacl permission for a folder.But it has more than 200 files.Is there any option with setacl to give permission to all 200 files.

quick response is highly appreciated


regards
himacs
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor
Solution

Re: setcl

Hi Himacs:

You can specify multiple files like:

setacl [-n] -f acl_file file...

The elipses after "file" (i.e. "file...") mean that you can repeat this argument.

Hence you could do something like:

# FILES=$(find /path -xdev -type f)

# setacl -f acl_file ${FILES}

For details, see:

http://docs.hp.com/en/B2355-60130/setacl.1.html

Regards!

...JRF...
OldSchool
Honored Contributor

Re: setcl

the "man" page would indicate that it (setacl) supports multiple files at the same time. which leads me to believe that, within the folder you could

setacl ..... *

where the shell expands the "*" to all of the names found.

of course, if there are subdirectories, that might cause an issue. you could also use "find .... -exec setacl ..." to locate any files and the run the setacl.

I'm sure there are other ways as well
Roopesh Francis_1
Trusted Contributor

Re: setcl

If you need to set only for files in a particular directory ,use below
find -type f -exec setacl -m u/g:permission: {} \;
all the files/directories in a particular directory ,use below
setacl -m u/g:permission:\*
himacs
Super Advisor

Re: setcl

Hi ,
thanx for the repliesss.

i am thinking to write a loop script for this.
But my concern is subfolders..


regards
himacs
James R. Ferguson
Acclaimed Contributor

Re: setcl

Hi (again) himacs:

> i am thinking to write a loop script for this. But my concern is subfolders..

I already offered a solution that will collect the files from subdirectories. Why do you want to write a loop...and to do what? See my original suggestion.

Regards!

...JRF...
himacs
Super Advisor

Re: setcl



yes James,

full points..



regards

himacs
himacs
Super Advisor

Re: setcl

I found this thread as very useful..