☰
Debian Codegraph
@
2.1.2-18.1
/
/
scripts
/
unprefix
☽
☼
scripts/unprefix
code
plain
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%^//*%%'