Error in creating shard cluster mongodb
This is resolved now. What I did is to start the mongos at a specific port number,like:

mongos --configdb "myrepl/localhost:27019,localhost:27020 --port 47019

Then I connected a mongo instance to it:

mongo --host localhost --port 47019

Further I executed all the commands to add shards in this shell and it worked! Please correct me if I'm wrong