#!/bin/bash id=`hive -e "set hive.cli.print.header=false;select id,name from test.test where name = 'wangwu' group by id,name;"` echo ----------------------------- echo $id echo -----------------------------