2018-04-03 22:00:58 +01:00
|
|
|
#!/bin/bash
|
2017-12-31 16:30:40 +00:00
|
|
|
|
|
|
|
from=${1}
|
|
|
|
to=${2}
|
2018-04-03 21:23:57 +01:00
|
|
|
common=$(printf '%s\n%s' "${from}" "${to}" | sed 'N;s/\(.*\).*\n\1.*$/\1/' | sed 's@/[^/]*$@/@')
|
|
|
|
prefix=$(printf '%s\n' "${from#$common}" | sed 's@[^/][^/]*@..@g')
|
2017-12-31 16:30:40 +00:00
|
|
|
printf '%s\n' "$prefix/${to#$common}"
|