转自:https://blog.csdn.net/t___z/article/details/78492113
#!/bin/bash hive -e "use lbi;show tables;" > hivetables.txt sleep(2) cat hivetables.txt |while read eachline do hive -e "show create table $eachline;" >>hivetablesDDL.txt done