... I have to create a shell script which copies all the id,name values from TableA and inserts them in TableB.
Is this possible? Any help is appreciated.
thanks
To misquote an old TV show, "Of course it's possible; don't be ridiculous."

And it's really trivial.
You could try something like:
mysql -u username -e 'insert into TableB select col1,col2 from TableA;'
You have to enter the password manually; if it needs to run unattended, you can include the '-p password' option on the command line.