I have a bash script that do some Database Jobs. parts of this script:
DBNAME_ARRAY=( mydb1 mydb2 )
DB2PATH=/bin/db2
BACKUPLOGPATH=/data1/`date +%y-%m-%d`_BACKUP.out
IP=170.10.20.11
.
.
for DBNAME in "${DBNAME_ARRAY[@]}"
do
BACKUPSQL="BACKUP DATABASE $DBNAME TO /dbdata1/${DBNAME,,}Backup"
$DB2PATH connect to $DBNAME
.
.
before i execute this i want to know if variables are placed in every line correctly. is this possible?
for example i want something like this:
BACKUP DATABASE mydb1 TO /dbdata1/mtdb1Backup
/bin/db2 connect to mydb1
BACKUP DATABASE mydb1 TO /dbdata2/mtdb1Backup
/bin/db2 connect to mydb2
after i check that everything is correct i run them.
BACKUPSQLinitialization in your code shown