my code is somehow like-
if [[ ! $FIRST=~ ^/ ]] then
FIRST="${SECOND}/${FIRST}"
fi
and i am getting below error while running the script in HP UNIX- syntax error at line 354 : `=~' unexpected. It seems to work fine in linux. Does anybody has any solution for it?
As the comments indicate, the ksh on HP-UX is probably pretty old, so there's no
=~
operator.However, you're just checking that the value begins with a slash, so use glob-style pattern matching:
If that doesn't work, use
case
: