Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true; do
- read -p "What is the table name?" table_name
- table_name=${table_name,,}
- if hdfs dfs -test -e /foo/$table_name ;
- then read -p "What is the target database you want to copy the
- “foo.${table_name}” table to?
- Your three options are:
- 1) database1
- 2) database2
- 3) database3
- Type 1, 2, or 3: " target_db;
- (((Here is where I want to state if $target_db = "1" then target_db_name
- = "database1", if $target_db = "2" then target_db_name = "database2" etc...)))
- read -p "Would you like to begin the HDFS copy with the following configuration:
- Target Database: ${target_db_name}
- Table Name: ${table_name}
- Continue (Y/N):"
- else echo "Please provide a valid table name.
- Exiting this script" ; exit ; fi
- done
- "....Type 1, 2, or 3: " target_db;
- else if $target_db = "1" then target_db_name = "edw_qa_history"; fi
Add Comment
Please, Sign In to add comment