I have below lines in unix script;
list_table_name=`hive -e 'show tables from schema'| grep -i 'hst_*' |sort -r|head -1`
When executing the script order of the commands is getting changed.
Sometimes the order is coming as
hive -e 'show tables from schema'grep -i 'hst_*'sort -rhead -1
but sometimes the order is coming as
hive -e 'show tables from schema'sort -rhead -1grep -i 'hst_*'
Why this is happening?