#!/bin/bash
TEMP=/home/dbpro/dfinsert.tmp
sql=$(df /Aplikasi | awk '{if (NR!=1){print}}' | sed -e 's/\S\+/:/G' > ${TEMP}
while IFS == read -r col1 col2 col3 col4 col5 col6;
do
MOUNT=$(printf '%s\n' $col6 )
PCT=$(printf '%s\n' $col5)
AVAILABLE=$(printf '%s\n' $col4)
USED=$(printf '%s\n' $col3)
MEMORY_CAPACITY=$(printf '%s\n' $col2))
sqlplus / "as sysdba" << EOF
insert into df_test
values ('$MOUNT','$PCT','$AVAILABLE','$USED','$MEMORY_CAPACITY');
commit;
exit;
EOF
done
when i executed the program it was running but it was not insert to the database table.
did I missing something with that code? please help, thank you.