cat table.txt
t1
cat clume.sh
table_name=$1
cat ${table_name}|while read line
do
` hive -e "SET hive.cli.print.header=false;SHOW COLUMNS IN default.$line" | sed -e ':label;N;s/\n/,/;b label' |sed -e 's/[ ][ ]*//g'|sed 's/^/grant select\(/g'|sed 's/$/\) on table default.'"$line"' TO role tm_read/g' >>9`
done
sed -i 's/,WARN:Themethodclassorg.apache.commons.logging.impl.SLF4JLogFactory#release()wasinvoked.,WARN:Pleaseseehttp:\/\/www.slf4j.org\/codes.html#releaseforanexplanation.//g' 9
sh clumn.sh table.txt