mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
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.
7 lines
228 B
Bash
Executable file
7 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}"
|