search_string="^Module $MODULENAME (not available|version $required not available|version $required not available \(but other versions are available\))\$"
else
search_string="^Loaded $MODULENAME version $expected\$"
fi
# The funny sed command here is from https://unix.stackexchange.com/a/235016/445931
# The reason this is needed is because the "Starting iocInit" message seems to be threaded
# differently than the regular flow of output and sometimes will separate the strings that
# we are looking for. If we simply cut it out then we seem to be able to more consistently
# get meaningful tests.
echo exit | eval iocsh.bash "$iocsh_args" | \
sed-e'1h;2,$H;$!d;g'-e's/Starting iocInit\niocRun: All initialization complete\n//' | \
search_string="^Module $MODULENAME (not available|version $required not available|version $required not available \(but other versions are available\))\$"
else
search_string="^Loaded $MODULENAME version $expected\$"
fi
# The funny sed command here is from https://unix.stackexchange.com/a/235016/445931
# The reason this is needed is because the "Starting iocInit" message seems to be threaded
# differently than the regular flow of output and sometimes will separate the strings that
# we are looking for. If we simply cut it out then we seem to be able to more consistently
# get meaningful tests.
echo exit | eval iocsh.bash "$iocsh_args" |
sed-e'1h;2,$H;$!d;g'-e's/Starting iocInit\niocRun: All initialization complete\n//' |