diff --git a/migration/migrate_oracle.sh b/migration/migrate_oracle.sh index 6ed006048a..7759af40c3 100644 --- a/migration/migrate_oracle.sh +++ b/migration/migrate_oracle.sh @@ -28,10 +28,10 @@ do if [ "$DIR" = "commit" ]; then COMMIT=1 else - for file in $DIR/oracle/*.sql; do - echo "SELECT '`basename $file`' AS Filename FROM dual;" + ls $DIR/oracle/*.sql | while read file; do + echo "SELECT '`basename "$file"`' AS Filename FROM dual;" echo - cat $file | dos2unix + cat "$file" | dos2unix echo echo done @@ -39,20 +39,20 @@ do done if [ -d $DIRINI/../processes_post_migration/oracle ] then - for file in $DIRINI/../processes_post_migration/oracle/*.sql; do - echo "SELECT '`basename $file`' AS Filename FROM dual;" + ls $DIRINI/../processes_post_migration/oracle/*.sql | while read file; do + echo "SELECT '`basename "$file"`' AS Filename FROM dual;" echo - cat $file | dos2unix + cat "$file" | dos2unix echo echo done fi if [ -d $DIRINI/../my_processes_post_migration/oracle ] then - for file in $DIRINI/../my_processes_post_migration/oracle/*.sql; do - echo "SELECT '`basename $file`' AS Filename FROM dual;" + ls $DIRINI/../my_processes_post_migration/oracle/*.sql | while read file; do + echo "SELECT '`basename "$file"`' AS Filename FROM dual;" echo - cat $file | dos2unix + cat "$file" | dos2unix echo echo done diff --git a/migration/migrate_postgresql.sh b/migration/migrate_postgresql.sh index fc95be2f68..0c6338a100 100644 --- a/migration/migrate_postgresql.sh +++ b/migration/migrate_postgresql.sh @@ -25,10 +25,10 @@ do if [ "$DIR" = "commit" ]; then COMMIT=1 else - for file in $DIR/postgresql/*.sql; do - echo "SELECT '`basename $file`' AS Filename;" + ls $DIR/postgresql/*.sql | while read file; do + echo "SELECT '`basename "$file"`' AS Filename;" echo - cat $file | dos2unix | sed 's/commit[ ]*;//I' + cat "$file" | dos2unix | sed 's/commit[ ]*;//I' echo echo done @@ -36,7 +36,7 @@ do done if [ -d $DIRINI/../processes_post_migration/postgresql ] then - for file in $DIRINI/../processes_post_migration/postgresql/*.sql; do + ls $DIRINI/../processes_post_migration/postgresql/*.sql | while read file; do echo "SELECT '`basename $file`' AS Filename;" echo cat $file | dos2unix | sed 's/commit[ ]*;//I' @@ -46,10 +46,10 @@ then fi if [ -d $DIRINI/../my_processes_post_migration/postgresql ] then - for file in $DIRINI/../my_processes_post_migration/postgresql/*.sql; do - echo "SELECT '`basename $file`' AS Filename;" + ls $DIRINI/../my_processes_post_migration/postgresql/*.sql | while read file; do + echo "SELECT '`basename "$file"`' AS Filename;" echo - cat $file | dos2unix | sed 's/commit[ ]*;//I' + cat "$file" | dos2unix | sed 's/commit[ ]*;//I' echo echo done