Pattern: Use of undefined string replacement
Issue: -
String replacement in parameter expansion is a bash
and ksh
extension. dash
and POSIX sh
does not support it.
Example of incorrect code:
#!/bin/sh
echo "${var//foo/bar}"
Example of correct code:
#!/bin/sh
echo "$var" | sed 's/foo/bar/g'