Guest User

Untitled

a guest
Oct 20th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. while true; do
  2. read -p "What is the table name?" table_name
  3. table_name=${table_name,,}
  4. if hdfs dfs -test -e /foo/$table_name ;
  5. then read -p "What is the target database you want to copy the
  6. “foo.${table_name}” table to?
  7.  
  8. Your three options are:
  9. 1) database1
  10. 2) database2
  11. 3) database3
  12.  
  13. Type 1, 2, or 3: " target_db;
  14.  
  15. (((Here is where I want to state if $target_db = "1" then target_db_name
  16. = "database1", if $target_db = "2" then target_db_name = "database2" etc...)))
  17.  
  18. read -p "Would you like to begin the HDFS copy with the following configuration:
  19.  
  20. Target Database: ${target_db_name}
  21. Table Name: ${table_name}
  22.  
  23. Continue (Y/N):"
  24.  
  25. else echo "Please provide a valid table name.
  26. Exiting this script" ; exit ; fi
  27.  
  28. done
  29.  
  30. "....Type 1, 2, or 3: " target_db;
  31. else if $target_db = "1" then target_db_name = "edw_qa_history"; fi
Add Comment
Please, Sign In to add comment