Hi im trying to write a bash script that checks whether a parameter to a function is contained within a global variable DEPEND
so basically Ive attempted to do the following and similar
Code:
# for this example do stuff to ${1} and store in variable
# actual code just reg expresses out the actual part I require
# and works perfectly
# variable will contain values such as ant-core, cos, taglibrarydoc, javacc, jsr123
# etc etc
if [[ "${DEPEND}" == *${variable}* ]]; then
echo "here2"
fi
and so you understand what is being contained within depend it will normally be declared like:
CDEPEND=">=virtual/jdk-1.5"
DEPEND=">=dev-java/cos-1.1.1
>=dev-java/ant-core-1.7
=dev-java/something-1.1-r1
doc? (dev-java/taglibrarydoc)
${CDEPEND}"
does anyone have any ideas. This function has to be robust to spaces and other special characters.