How to enter a password in the script automatically when prompted?

Hi Friends,

We need to create a script which will invoke a command with diffrent parameters.

The command invoked needs the password. So how automatically we can enter password in the script to the command?

example.:

#!/bin/ksh

for par in `cat parfile` do

# Here is the main command that needs password
add_space $par 3000MB
##password will be prompted...

done

in this case how we can make script that will automatically enter password?

Thanks in advance..

This question has been asked at least n times (where n is a large number). Use the sites search feature looking for "automatic password" or "send password" or "expect"