PDA

View Full Version : I am in deep trouble please help



aliahsan81
November 21st, 2008, 03:11 PM
Hi all

I have a script that run fine ,Actually if find 777 directory and take its count and report,There is no problem with the script.But our reporting system have some limitation that dont allow more then 1000 directory to report,Now i want some way i can break this up and then report to the reporting system,My code is below,At the moment there are like 5000 777 directories.Please help i am blanked.Please its very urgent


#!/bin/bash

check=/var/www/html


res=$(find $check -type d -perm 777 2>/dev/null )
count=$(find $check -type d -perm 777 | wc -l)

echo $count
#echo $res

Reporting system command.

pmasiar
November 21st, 2008, 04:56 PM
5000+ directories? That's obviously bad design

create 2 level structure, instead of directory /abcd have /ab/abcd - and you are fine

aliahsan81
November 21st, 2008, 06:37 PM
I cant do thid becz its a dev server for programmer

akvino
November 21st, 2008, 08:46 PM
Hi all

I have a script that run fine ,Actually if find 777 directory and take its count and report,There is no problem with the script.But our reporting system have some limitation that dont allow more then 1000 directory to report,Now i want some way i can break this up and then report to the reporting system,My code is below,At the moment there are like 5000 777 directories.Please help i am blanked.Please its very urgent


#!/bin/bash

check=/var/www/html


res=$(find $check -type d -perm 777 2>/dev/null )
count=$(find $check -type d -perm 777 | wc -l)

echo $count
#echo $res

Reporting system command.




Use an output file. Try something like:
#!/bin/bash

check="/var/www/html"


find $check -type d -perm 755 > junk
res=`cat junk | wc -l`

printf "\nThe number of directories with 755 permisions is $res.\n";

rm -f junk

pp.
November 22nd, 2008, 01:23 AM
I cant do thid becz its a dev server for programmer

Whatduz■ismean?