I want to run an ANT script which prompts the user for input, so it needs to be interactive through the console. at the same time I want to log the console content to a log file
You can use tee.
tee
Example:
$ echo "Hello, world" | tee /tmp/outfile Hello, world $ cat /tmp/outfile Hello, world
tee writes its stdin to both stdout as well as one or more files given on the command line.