Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Issuing chmod commands using perl

by turo (Friar)
on Feb 19, 2006 at 17:37 UTC ( [id://531265]=note: print w/replies, xml ) Need Help??


in reply to Issuing chmod commands using perl

I've made an script, that read the list you subbmitted ... You can generate a shell script, for chmodding all your listed files:

perl -ne '($permissions,$file)=/(\d{3})\)(?:[^\)]+\))?(\S+)/ and print + "chmod $permissions $file\n"' list
...

Hope that helps ...

perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'

Replies are listed 'Best First'.
Re^2: Issuing chmod commands using perl
by localist (Initiate) on Feb 19, 2006 at 18:38 UTC
    In your script, insert something like -
    system ("chmod 755 cgi-bin/yabb2"); system ("chmod 755 cgi-bin/yabb2/AdminIndex.pl"); system ("chmod 755 cgi-bin/yabb2/FixFile.pl"); system ("chmod 666 cgi-bin/yabb2/Paths.pl"); system ("chmod 755 cgi-bin/yabb2/Setup.pl"); system ("chmod 755 cgi-bin/yabb2/YaBB.pl"); system ("chmod 777 cgi-bin/yabb2/Admin"); system ("chmod 666 cgi-bin/yabb2/Admin/*"); system ("chmod 777 cgi-bin/yabb2/Boards"); system ("chmod 666 cgi-bin/yabb2/Boards/*"); system ("chmod 777 cgi-bin/yabb2/Convert"); system ("chmod 777 cgi-bin/yabb2/Convert/Boards"); system ("chmod 777 cgi-bin/yabb2/Convert/Members"); system ("chmod 777 cgi-bin/yabb2/Convert/Messages"); system ("chmod 777 cgi-bin/yabb2/Convert/Variables"); system ("chmod 777 cgi-bin/yabb2/Help/English/Admin"); system ("chmod 777 cgi-bin/yabb2/Help/English/Admin/*"); system ("chmod 777 cgi-bin/yabb2/Help/English/Gmod"); system ("chmod 777 cgi-bin/yabb2/Help/English/Gmod/*"); system ("chmod 777 cgi-bin/yabb2/Help/English/Moderator"); system ("chmod 777 cgi-bin/yabb2/Help/English/Moderator/*"); system ("chmod 777 cgi-bin/yabb2/Help/English/User"); system ("chmod 777 cgi-bin/yabb2/Help/English/User/*"); system ("chmod 777 cgi-bin/yabb2/Languages/English"); system ("chmod 666 cgi-bin/yabb2/Languages/English/agreement.txt"); system ("chmod 666 cgi-bin/yabb2/Languages/English/censor.txt"); system ("chmod 777 cgi-bin/yabb2/Languages/English/*"); system ("chmod 777 cgi-bin/yabb2/Members"); system ("chmod 666 cgi-bin/yabb2/Members/*"); system ("chmod 777 cgi-bin/yabb2/Messages"); system ("chmod 666 cgi-bin/yabb2/Messages/*"); system ("chmod 777 cgi-bin/yabb2/Modules/Digest"); system ("chmod 777 cgi-bin/yabb2/Modules/Digest/HMAC_MD5.pm"); system ("chmod 777 cgi-bin/yabb2/Modules/Digest/MD5.pm"); system ("chmod 777 cgi-bin/yabb2/Modules/Time"); system ("chmod 777 cgi-bin/yabb2/Modules/Time/HiRes.pm"); system ("chmod 777 cgi-bin/yabb2/Modules/Upload"); system ("chmod 777 cgi-bin/yabb2/Modules/Upload/CGI.pm"); system ("chmod 777 cgi-bin/yabb2/Modules/Upload/CGI"); system ("chmod 777 cgi-bin/yabb2/Modules/Upload/CGI/Util.pm"); system ("chmod 766 cgi-bin/yabb2/Sources"); system ("chmod 755 cgi-bin/yabb2/Sources/*"); system ("chmod 766 cgi-bin/yabb2/Templates"); system ("chmod 766 cgi-bin/yabb2/Templates/default"); system ("chmod 666 cgi-bin/yabb2/Templates/default/*"); system ("chmod 766 cgi-bin/yabb2/Variables"); system ("chmod 666 cgi-bin/yabb2/Variables/*");

      I said shell script ... not perl script ...
      to make a perl script, would be more cool to use the 'chmod' perl function; but it didn't works for wildcarded paths like "/home/somewhere/*" ...

      A little more work ... but yesterday, i was a little bit lazzy ...

      Regards
      turo

      perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://531265]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found