[adimulamvenkat19851609@cxln4 ~]$ cat>db_tb_count.sh
#script
hive -e "show databases like 'mht*'" >db3.out;
cat db3.out |
while read line;
do
hive -e "use $line; show tables" >> tables3.out;
done;
cat tables3.out | wc -l>>tb_count.out;
[adimulamvenkat19851609@cxln4 ~]$ cat db3.out
mhtprabhu
hive -e "show databases like 'mht*'" >db3.out;
cat db3.out |
while read line;
do
hive -e "use $line; show tables" >> tables3.out;
done;
cat tables3.out | wc -l>>tb_count.out;
[adimulamvenkat19851609@cxln4 ~]$ cat db3.out
mhtprabhu
[adimulamvenkat19851609@cxln4 ~]$ cat tables3.out
emp_sample
employee_data
hari_tab
prabhu_tab
student
student4
student5
student_part
[adimulamvenkat19851609@cxln4 ~]$ cat tb_count.out
8