Skip to main content
fixed syntax highlighting
Source Link
Andriy M
  • 23.3k
  • 6
  • 60
  • 104
./sshi.sh vb20deployment controller <<'HERE' export PGPASSWORD="postgres" cd logu/postgresql/bin row=1 tableArray=(table1 table2 table3 table4 table5 table6) for (( x=0 ; x<=5 ; x++)) ; do ./psql.bin --port=5432 --username=postgres --host=hostname.rds.amazonaws.com --dbname=mydb -c "SELECT * FROM information_schema.tables WHERE '${tableArray[$x]}' = table_name" | while read -a Record ; do row=$((row + 1)) if [[ $row -gt 3 ]]; then echo ${Record[4]} fi done done HERE 
./sshi.sh vb20deployment controller <<'HERE' export PGPASSWORD="postgres" cd logu/postgresql/bin row=1 tableArray=(table1 table2 table3 table4 table5 table6) for (( x=0 ; x<=5 ; x++)) ; do ./psql.bin --port=5432 --username=postgres --host=hostname.rds.amazonaws.com --dbname=mydb -c "SELECT * FROM information_schema.tables WHERE '${tableArray[$x]}' = table_name" | while read -a Record ; do row=$((row + 1)) if [[ $row -gt 3 ]]; then echo ${Record[4]} fi done done HERE 
./sshi.sh vb20deployment controller <<'HERE' export PGPASSWORD="postgres" cd logu/postgresql/bin row=1 tableArray=(table1 table2 table3 table4 table5 table6) for (( x=0 ; x<=5 ; x++)) ; do ./psql.bin --port=5432 --username=postgres --host=hostname.rds.amazonaws.com --dbname=mydb -c "SELECT * FROM information_schema.tables WHERE '${tableArray[$x]}' = table_name" | while read -a Record ; do row=$((row + 1)) if [[ $row -gt 3 ]]; then echo ${Record[4]} fi done done HERE 
./sshi.sh vb20deployment controller <<'HERE' export PGPASSWORD="postgres" cd logu/postgresql/bin row=1 tableArray=(table1 table2 table3 table4 table5 table6) for (( x=0 ; x<=5 ; x++)) ; do ./psql.bin --port=5432 --username=postgres --host=hostname.rds.amazonaws.com --dbname=mydb -c "SELECT * FROM information_schema.tables WHERE '${tableArray[$x]}' = table_name" | while read -a Record ; do row=$((row + 1)) if [[ $row -gt 3 ]]; then echo ${Record[4]} fi done done HERE 
added 86 characters in body
Source Link
Philᵀᴹ
  • 32k
  • 10
  • 86
  • 108

./sshi.sh vb20deployment controller <<'HERE' export PGPASSWORD="postgres" cd logu/postgresql/bin row=1 tableArray=(table1 table2 table3 table4 table5 table6)

for (( x=0 ; x<=5 ; x++)) ; do

./psql.bin --port=5432 --username=postgres --host=hostname.rds.amazonaws.com --dbname=mydb -c "SELECT * FROM information_schema.tables WHERE '${tableArray[$x]}' = table_name" | while read -a Record ; do row=$((row + 1)) if [[ $row -gt 3 ]]; then

./sshi.sh vb20deployment controller <<'HERE' export PGPASSWORD="postgres" cd logu/postgresql/bin row=1 tableArray=(table1 table2 table3 table4 table5 table6) for (( x=0 ; x<=5 ; x++)) ; do ./psql.bin --port=5432 --username=postgres --host=hostname.rds.amazonaws.com --dbname=mydb -c "SELECT * FROM information_schema.tables WHERE '${tableArray[$x]}' = table_name" | while read -a Record ; do row=$((row + 1)) if [[ $row -gt 3 ]]; then echo ${Record[4]} fi done  done HERE 

fi done

done

HERE

./sshi.sh vb20deployment controller <<'HERE' export PGPASSWORD="postgres" cd logu/postgresql/bin row=1 tableArray=(table1 table2 table3 table4 table5 table6)

for (( x=0 ; x<=5 ; x++)) ; do

./psql.bin --port=5432 --username=postgres --host=hostname.rds.amazonaws.com --dbname=mydb -c "SELECT * FROM information_schema.tables WHERE '${tableArray[$x]}' = table_name" | while read -a Record ; do row=$((row + 1)) if [[ $row -gt 3 ]]; then

 echo ${Record[4]} 

fi done

done

HERE

./sshi.sh vb20deployment controller <<'HERE' export PGPASSWORD="postgres" cd logu/postgresql/bin row=1 tableArray=(table1 table2 table3 table4 table5 table6) for (( x=0 ; x<=5 ; x++)) ; do ./psql.bin --port=5432 --username=postgres --host=hostname.rds.amazonaws.com --dbname=mydb -c "SELECT * FROM information_schema.tables WHERE '${tableArray[$x]}' = table_name" | while read -a Record ; do row=$((row + 1)) if [[ $row -gt 3 ]]; then echo ${Record[4]} fi done  done HERE 
Source Link

./sshi.sh vb20deployment controller <<'HERE' export PGPASSWORD="postgres" cd logu/postgresql/bin row=1 tableArray=(table1 table2 table3 table4 table5 table6)

for (( x=0 ; x<=5 ; x++)) ; do

./psql.bin --port=5432 --username=postgres --host=hostname.rds.amazonaws.com --dbname=mydb -c "SELECT * FROM information_schema.tables WHERE '${tableArray[$x]}' = table_name" | while read -a Record ; do row=$((row + 1)) if [[ $row -gt 3 ]]; then

 echo ${Record[4]} 

fi done

done

HERE