Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a limit on CHMOD ?

Status
Not open for further replies.

maxcrook

Programmer
Jan 25, 2001
210
GB
I have a script that chmods files in a directory, however the following error appears when there are more than 600 files present in the directory where the chmod is taking place.
Does anyone know what is causing this?
Is it a unix bug? or a problem with my system ?

/usr/bin/chmod: 0403-027 The parameter list is too long.
 
Its a UNIX 'thing' - you need to code some sort of loop in your script

Alex
 
Look up "xargs"...

for file in `ls |xargs -L 100` ; do
chmod blah blah $file
done

The same limits exist in ls, chown, chmod, etc...although they may be bigger, they do exist.

The "-L" command specifies how many parameters are passed to the program per pass. In my example, if there are 600 files in your directory, it will break them into 6 groups of 100.

Bill.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top