1 2 3 4 5 6 7 8
#!/bin/sh line='/foo/bar/*/baz' if [ "/foo/bar/" != ${line%%\**}"" ] then echo broken exit 1 fi