Disk space reporting

I need to accomplish the following task -
I have a number of accounts for a number of applications that i deploy on a unix server. There are a number of directories for each account in /prod/apps directory. eg. For an account Application1 I have /prod/apps/Application1_1 /prod/apps/Application1_2 etc. Now I need to gather the information about the usage of each folder under each of /prod/apps. For that I want to sudo su to each application account and then gather the info by say du or df or ls -l. I tried to use expect script but once I execute a sudo su - application1 and output the password the script gets blocked because a new shell is spawned.
Kindly help me out of the issue. Also suggest me any other method if there is one.
Thanks in advance
-Niranjan

aah! I am facing same issue and searching resolution frm past 1 year, everyone says that there is no way to pass password to sudo, actuly I was trying to login to unix servers using ssh thru script but every one suggested u shud hav public private key configured.. else no otehr go.. and the script is for ease of my work and organization wont except to configure pp key configuration ...Is there any way I can Pass passwod to ssh? so that I can run the srcipt without any password prompt. Script is to capture some data from some unix servers and send a report

@ niranjandighe you should start somewhere first, let's see if du will do the job.

du -hcd 1 /prod/apps/

@ sunilmenhdiratt Your post is off-topic , please do not reply !

You should search the forum first and post only if you didn't find any solution.
Tip: man expect(1)

niranjandighe
I think your query is not very clear. From what i gather, u want to run a script to give u disk usage of some folders but you do not indicate that you want to run the script from a remote system or locally. If you have supersuer privelages , i do not see why u need a password to su - as another user.

Share your expect script to help us understand yr problem.

I do not have the supper user priviledge. The folders Application1_1 Application1_2 etc are owned by the Application1 account. They have a number of folders (corrosponding to versions of applications deployed and I wish to clear out the old versions based on size etc). Now as I do not have the previlidge to peep into those folders (Application1_1, Application1_2, etc) I am trying to sudo to Application1 to get the info. I just have an account apptest from which I can sudo su to the other Application accounts.
Here is the snippet from the expect I am trying to run, which is invoked through a shell script.

#################
#Main script master.sh
#################

#!/bin/bash
./sudoer
#some cleanup activity
.
.
.

#########################
#The expect script snippet "sudoer"
########################

#!/usr/bin/expect
spawn sudo su - Application1
expect "Password:"
send "Password123\r"
interact
#-> At this point the script gets blocked as a new shell is being invoked and does not return to the shell script at the top.