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'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.