Problem in redirecting standard input and output

view story

http://askubuntu.com – I want to take backup of my mysql data using mysqldump. I have three files containing names of mysql tables line by line. My script has this line - mysqldump -h localhost -uroot --lock-tables=false db < $2 > ~/backup/$name'.sql' I am using getopts to handle some options. So basically $2 is the file I am going to provide. This file has - table1 and table2. So this command should only take backup of these two tables. But when I cat the ~/backup/name.sql file it shows all the backup of db. I am not sure if it is the combined backup of all the tables from all the 3 files or the whole (HowTos)