mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-12-27 09:04:40 +01:00
f8fa4213f1
These commands fail on systems that do not have bash under /bin Signed-off-by: William Casarin <jb55@jb55.com>
8 lines
241 B
Bash
Executable File
8 lines
241 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
from=${1}
|
|
to=${2}
|
|
common=$(printf '%s\n%s' "${from}" "${to}" | sed 'N;s/\(.*\).*\n\1.*$/\1/' | sed 's@/[^/]*$@/@')
|
|
prefix=$(printf '%s\n' "${from#$common}" | sed 's@[^/][^/]*@..@g')
|
|
printf '%s\n' "$prefix/${to#$common}"
|