1 2 3 4 5 6 7 8
#! /bin/sh # slash_path_relpath : lines (path ":" relpath) |> lines path # # Example: "/foo/bar: baz" => "/foo/baz" # set -euf sed -n 's@/[^/]\+:@/@p'