Listing 4. Add Path Element to Path Variable

# main
element=$(eval echo \$$pathvar | colon2line |
   grep -x "$dirname")
if [ "$element" = "" ]
then
# $dirname is not currently in pathvar so
# add it
eval eval $pathvar=$COMMAND
fi