stockholm/bin/make-relative-to

7 lines
176 B
Plaintext
Raw Normal View History

2015-05-20 23:56:08 +00:00
#! /bin/sh
# make-relative-to : lines path |> directory -> lines path
# Non-matching paths won't get altered.
set -euf
sed "s:^$(echo "$1/" | bre-escape | sed 's/:/\\:/g')::"