我正在尝试构建一个shell脚本,它以表\u name作为参数,并运行下面的配置单元查询。
INSERT OVERWRITE DIRECTORY '/data/table_name' row format delimited FIELDS TERMINATED BY ',' SELECT * FROM table_name
vngu2lb81#
也许你需要它:
# !/bin/bash if [ -z "$1" ]; then exit 1; fi printf -v TAB "%q" "$1" /usr/bin/mysql -NBe "INSERT OVERWRITE DIRECTORY '/data/table_$TAB' row format delimited FIELDS TERMINATED BY ',' SELECT * FROM $TAB"
1条答案
按热度按时间vngu2lb81#
也许你需要它: