if [ "$affectedRow" == "" ]; then
echo "Look to the next OMCDB"
$SYBASE/$SYBASE_OCS/bin/isql -P password -S UXESPOMC02 -o dbOutput.log <<EOF
select sub_number, pool_number, VMU_number from mmsdb..subscr_standard where sub_number = "$MSISDN"
go
exit
else
echo "Is not Empty"
fi
The output error is: ./SMBGenerator.sh: line 30: syntax error: unexpected end of file
Should be on the line after fi without a leading space. Does it work properly if you type the commands on the command line?
Have you save the script with a windows editor?
if [ "$affectedRow" == "" ]; then
echo "Look to the next OMCDB"
$SYBASE/$SYBASE_OCS/bin/isql -P tecnote7 -S UXESPOMC02 -o dbOutput.log << EOF
select sub_number, pool_number, VMU_number from mmsdb..subscr_standard where sub_number = "$MSISDN"
go
quit
else
echo "Is not Empty"
fi
EOF
which lead to the same, and i tried teh commands seperatly and was working, but once compined them togather, something happen.
if [ "$affectedRow" == "" ]; then
echo "Look to the next OMCDB"
$SYBASE/$SYBASE_OCS/bin/isql -P tecnote7 -S UXESPOMC02 -o dbOutput.log << EOF
select sub_number, pool_number, VMU_number from mmsdb..subscr_standard where sub_number = "$MSISDN"
go
quit
EOF
else
echo "Is not Empty"
fi
./SMBGenerator.sh: line 32: syntax error: unexpected end of file
One of isql man pages says it requires an empty line before the end.
So you would need something like:
...
if [ "$affectedRow" == "" ]; then
echo "Look to the next OMCDB"
$SYBASE/$SYBASE_OCS/bin/isql -P password -S UXESPOMC02 -o dbOutput.log <<EOF
select sub_number, pool_number, VMU_number from mmsdb..subscr_standard where sub_number = "$MSISDN"
go
quit
EOF
else
echo "Is not Empty"
fi