I am trying to generate a csv file for utilization of each project directory. there are 10 filesystem and for each filesystem there are 16 directory.
i was trying to create a script so i created two file. one is filesystem and one is project. so file looks like
cat filesystems
/app1
/app2
/app3
....
....
/app10
cat project
proj1
proj2
....
....
proj16
Now, I want to create a script so that it will check du for /app1/proj1 then /app1/proj2 then /app1/proj3 and so on till /app1/proj16 and O/P will write to out.csv file
After /app1 completes then again it will start for /app2/proj1 then /app2/proj2 and so on and O/P will write to out.csv file in a new line
and finally script will run for /app10/proj1 then /app10/proj2 and so on till /app10/pro16 and O/P will write to out.csv
values_check=`paste -d/ first_file_disk second_file_disk`
set -A array_values_check values_check ${values_check}
for i in ${array_values_check[@]}
do
echo "***************************************************"
du $i
echo "***************************************************"
done
Where first_file_disk second_file_disk are two files.
Thanks Akshay It worked ..
Need one more help
When I do cat projects|wc -l then i get O/P as 16
Now I want to create a file (say file1) where exact 16 entries should be there with only date value
example -- when I do cat for file1, it should like below