Hi All,
I need your small help in using IFS.
I am using it like below but i am not getting the desired output.
var=ABCD,EFGH,IJKL,MNOP,QRST
export IFS=","
for x in $var
do
if [[ $GP == "" ]]
then
temp="Group_$x"
GP=${!temp}
else
temp="Group_$x"
MP="${!temp}"
GP="$GP","$MP"
fi
done
echo $GP
Seems IFS also applies on $GP whereas i want the output(GP) separted by comma(,)
Desired Output:
Model output is (valueof)ABCD, (valueof)EFGH, (valueof)IJKL, (valueof)MNOP
Obtained output:
(valueof)ABCD (valueof)EFGH (valueof)IJKL (valueof)MNOP
Any help !! Thanks in advance!