0

I am receiving a query via a configuration file in unix, for ex. Config file content will be in the format:

Table_name|query

ABC|select ABC.A,ABC.B from PQR left join (select * from ABC) on ABC.pk=PQR.pk

I am trying to process query part as below :

    while read line in config_file
    do
        query=`echo $line|awk -F "|" '{print $1}'`
        result=hive -e "$query"
        ...

However the '*' in query variable is getting expanded to the listing of files in the current directory

Could you please help how to escape the * character, i searched for the solution but could not find one.

AdminBee
  • 22,803

1 Answers1

0

Hi Saket Mankar and welcome to the community!

You would need to enclose the $line variable with double quotes: "$line".

That should solve your situation.

Thorian93
  • 753