I have a bash
script like below. Near table
variable I want to use backticks like in my script.
#!/bin/bash
[ $# -ne 2 ] && { echo "Usage : $0 database table "; exit 1; }
database=$1
table=$2
hive -e "alter table ${database}.`${table}` SET TBLPROPERTIES('EXTERNAL'='FALSE')"
This above script gives me below error
script.sh: line 10: table: command not found
But if I don't use backticks near table variable then the script works fine.
But I need to have backticks near table
variable. How can I do that?
I have tried like below as well
hive -e "alter table ${database}.$(table) SET TBLPROPERTIES('EXTERNAL'='FALSE')"
I still got the same error.