troubleshooting Question

Shell script question

Avatar of joaotelles
joaotellesFlag for United States of America asked on
Shell Scripting
3 Comments1 Solution578 ViewsLast Modified:
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
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros