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
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue