joaotelles
asked on
Shell script question
Hi,
Im having a problem with this piece of the shell script:
#!/bin/sh
echo 'Enter the MSISDN (with the 1 at the beginning)'
read MSISDN
echo "MSISDN used: ${MSISDN}"
SID=${ORACLE_SID}
dpsn_id=`sqlplus -s ${db_user}/${db_pass}@${SI D} <<!
set heading off
set feedback off
select dpsn_id from dp_subscription where dpsn_destinationaddress = ${MSISDN};
exit;
!`
if [ $dpsn_id == "" ]
then
echo 'No subscription was found for this MSISDN' exit 1
fi
When the querry returns nothing (the if condition) Im getting this:
./test4: test: argument expected
Let me know what Im missing.
Tks,
Joao
Im having a problem with this piece of the shell script:
#!/bin/sh
echo 'Enter the MSISDN (with the 1 at the beginning)'
read MSISDN
echo "MSISDN used: ${MSISDN}"
SID=${ORACLE_SID}
dpsn_id=`sqlplus -s ${db_user}/${db_pass}@${SI
set heading off
set feedback off
select dpsn_id from dp_subscription where dpsn_destinationaddress = ${MSISDN};
exit;
!`
if [ $dpsn_id == "" ]
then
echo 'No subscription was found for this MSISDN' exit 1
fi
When the querry returns nothing (the if condition) Im getting this:
./test4: test: argument expected
Let me know what Im missing.
Tks,
Joao
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Tks
or
if [[ $dpsn_id == "" ]] ...