Debian Codegraph @

scripts/unprefix

raw
1 #!/bin/sh
2 # usage: unprefix prefix path
3 #
4 # Print path, but if it starts with prefix, first remove the prefix.
5 echo "$2" \
6 | sed -e 's%^'"`echo $1|sed 's%//*$%%'`"'%%' -e tn -e q -e ':n' -e 's%^//*%%'