source command inside a shell script does not work if a key contains multiple values

I have a file, interfaceDetail , who content are as below:

AP=Northbound
AC=Southbound
RADIUS=Northbound

Now when i change interfaceDetail's content to below:

AP=Northbound
AC=Southbound
RADIUS=Southbound Northbound

i get the error " line 3: Northbound: command not found"  from all places where i try to source interfaceDetail .
How do i have multiple values to my key in a source file?
pvinodpAsked:
Who is Participating?
 
ozoConnect With a Mentor Commented:
Depending on how RADIUS is used in the shell script,
and maybe on which shell is running the script, you might use
RADIUS='Southbound Northbound'
or perhaps
RADIUS=(Southbound Northbound)
0
 
Gerwin Jansen, EE MVEConnect With a Mentor Topic Advisor Commented:
or double quotes:

RADIUS="Southbound Northbound"

If that doesn't work can you post (part) of a script where you source/use RADIUS?
0
 
omarfaridCommented:
Can you explain what you mean by "multiple values" how you are going to use them?

If you want just to assign the values to the variable then just put " or ' around the values
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
MikeOM_DBACommented:
try:
AP=Northbound
AC=Southbound
RADIUS="$AP $AC"
#   Or ...
 set -A RADIUS $AP $AC

Open in new window

0
 
Ramakanta SahooCommented:
In Bash you can do something like below

#!/bin/bash
RADIUS=( Southbound Northbound )

for radius in ${RADIUS[@]}
    do
    # DO whatever you want to do here
    echo $radius
    done
0
 
pvinodpAuthor Commented:
thanks for your quick response
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.