mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-19 05:44:12 +01:00
e6de41b468
Fixes: #1221 We were using `\x0` to match NUL chars in the input (on the assumption that NUL chars are "impossible" for decent LFS-compliant systems). However `\x0` is a GNUism. Use the `\n` and the newline character, which is supported by (most) POSIX sed.
8 lines
228 B
Bash
Executable File
8 lines
228 B
Bash
Executable File
#! /bin/sh
|
|
|
|
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}"
|