Link to home
Start Free TrialLog in
Avatar of joaotelles
joaotellesFlag for United States of America

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}@${SID} <<!
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
Avatar of msk_1227
msk_1227

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of woolmilkporc
if [ "$dpsn_id" == "" ] ...

or

if [[  $dpsn_id == "" ]] ...
Avatar of joaotelles

ASKER

Tks