Guest User

Untitled

a guest
Oct 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # file_path contains the name of the file that
  4. # will contain the create schema statement
  5.  
  6. file_path='create_schema.sql'
  7.  
  8. # Now we will remove file if exists
  9. if [ -f $file_name ] ; then
  10. rm $file_path
  11. fi
  12.  
  13. schema_directories=(
  14. "users"
  15. "tables"
  16. )
  17.  
  18.  
  19. # Let's loop through the directories and create our schema statement
  20. for dir in "${schema_directories[@]}"
  21. do
  22. for file in "$dir/*"
  23. do
  24. cat $file >> $file_path
  25. done
  26. done
  27.  
  28. # All done!! Urray!!
Add Comment
Please, Sign In to add comment