get the total execution of command

hi,

i have to get the info between start to stop of a command execution
suppose,
if we execute the command like pkgadd [pkgs] then while its executing it ask some questions , i have to get total information untill pkgadd command complete into a perticular file.

I assume you want a transcript of the session?

Use the 'script' command.

$ script
Script started, file is typescript
$ echo "blah"
blah
$ exit
Script done, file is typescript
$

The 'typescript' file will contain all of the commands and output.

that is fine but whenever u type $script it shouldn't ask for new commands it should take predefined command automatically.

I'm unable to discern what it is you're actually after, but if you mean you wish to use a pre-canned set of responses to pkgadd, then see the "-r" flag for pkgadd, which allows you to specify a response file.