To successfully build the pipeline, it was required to automate all the yes invocation while executing Anaconda sh file.

I did by invoking sh file with -b option bash Anaconda2-5.0.1-Linux-x86_64.sh -b