Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # file_path contains the name of the file that
- # will contain the create schema statement
- file_path='create_schema.sql'
- # Now we will remove file if exists
- if [ -f $file_name ] ; then
- rm $file_path
- fi
- schema_directories=(
- "users"
- "tables"
- )
- # Let's loop through the directories and create our schema statement
- for dir in "${schema_directories[@]}"
- do
- for file in "$dir/*"
- do
- cat $file >> $file_path
- done
- done
- # All done!! Urray!!
Add Comment
Please, Sign In to add comment