Change migrate_ scripts to manage files with spaces
This commit is contained in:
parent
0979f1d925
commit
35d756e764
|
@ -28,10 +28,10 @@ do
|
||||||
if [ "$DIR" = "commit" ]; then
|
if [ "$DIR" = "commit" ]; then
|
||||||
COMMIT=1
|
COMMIT=1
|
||||||
else
|
else
|
||||||
for file in $DIR/oracle/*.sql; do
|
ls $DIR/oracle/*.sql | while read file; do
|
||||||
echo "SELECT '`basename $file`' AS Filename FROM dual;"
|
echo "SELECT '`basename "$file"`' AS Filename FROM dual;"
|
||||||
echo
|
echo
|
||||||
cat $file | dos2unix
|
cat "$file" | dos2unix
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
@ -39,20 +39,20 @@ do
|
||||||
done
|
done
|
||||||
if [ -d $DIRINI/../processes_post_migration/oracle ]
|
if [ -d $DIRINI/../processes_post_migration/oracle ]
|
||||||
then
|
then
|
||||||
for file in $DIRINI/../processes_post_migration/oracle/*.sql; do
|
ls $DIRINI/../processes_post_migration/oracle/*.sql | while read file; do
|
||||||
echo "SELECT '`basename $file`' AS Filename FROM dual;"
|
echo "SELECT '`basename "$file"`' AS Filename FROM dual;"
|
||||||
echo
|
echo
|
||||||
cat $file | dos2unix
|
cat "$file" | dos2unix
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [ -d $DIRINI/../my_processes_post_migration/oracle ]
|
if [ -d $DIRINI/../my_processes_post_migration/oracle ]
|
||||||
then
|
then
|
||||||
for file in $DIRINI/../my_processes_post_migration/oracle/*.sql; do
|
ls $DIRINI/../my_processes_post_migration/oracle/*.sql | while read file; do
|
||||||
echo "SELECT '`basename $file`' AS Filename FROM dual;"
|
echo "SELECT '`basename "$file"`' AS Filename FROM dual;"
|
||||||
echo
|
echo
|
||||||
cat $file | dos2unix
|
cat "$file" | dos2unix
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
|
|
@ -25,10 +25,10 @@ do
|
||||||
if [ "$DIR" = "commit" ]; then
|
if [ "$DIR" = "commit" ]; then
|
||||||
COMMIT=1
|
COMMIT=1
|
||||||
else
|
else
|
||||||
for file in $DIR/postgresql/*.sql; do
|
ls $DIR/postgresql/*.sql | while read file; do
|
||||||
echo "SELECT '`basename $file`' AS Filename;"
|
echo "SELECT '`basename "$file"`' AS Filename;"
|
||||||
echo
|
echo
|
||||||
cat $file | dos2unix | sed 's/commit[ ]*;//I'
|
cat "$file" | dos2unix | sed 's/commit[ ]*;//I'
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
@ -36,7 +36,7 @@ do
|
||||||
done
|
done
|
||||||
if [ -d $DIRINI/../processes_post_migration/postgresql ]
|
if [ -d $DIRINI/../processes_post_migration/postgresql ]
|
||||||
then
|
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 "SELECT '`basename $file`' AS Filename;"
|
||||||
echo
|
echo
|
||||||
cat $file | dos2unix | sed 's/commit[ ]*;//I'
|
cat $file | dos2unix | sed 's/commit[ ]*;//I'
|
||||||
|
@ -46,10 +46,10 @@ then
|
||||||
fi
|
fi
|
||||||
if [ -d $DIRINI/../my_processes_post_migration/postgresql ]
|
if [ -d $DIRINI/../my_processes_post_migration/postgresql ]
|
||||||
then
|
then
|
||||||
for file in $DIRINI/../my_processes_post_migration/postgresql/*.sql; do
|
ls $DIRINI/../my_processes_post_migration/postgresql/*.sql | while read file; do
|
||||||
echo "SELECT '`basename $file`' AS Filename;"
|
echo "SELECT '`basename "$file"`' AS Filename;"
|
||||||
echo
|
echo
|
||||||
cat $file | dos2unix | sed 's/commit[ ]*;//I'
|
cat "$file" | dos2unix | sed 's/commit[ ]*;//I'
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue