Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Shell script for Hive Hbase Table creation

Shell script for Hive Hbase Table creation

New Contributor
 
1 REPLY 1
Highlighted

Re: Shell script for Hive Hbase Table creation

Super Collaborator

try out the date command

date +%b
date +%Y

or you can also try to combine it:

date +%b-%Y

i assume you know how to put the output of a shell command into a variable or use it as a text?

So if you want a name, even in lowercase as per your example:

tablename="anjddcm_`date +%b | awk '{print tolower($0)}'`_jki_`date +%Y`"
echo "$tablename"

Also you can try to use python as your scripting language which will give you more flexibility

Don't have an account?
Coming from Hortonworks? Activate your account here