From 0a5e023f09d53a4bc784865005003768bf21b877 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 19 Sep 2011 00:20:53 +0200 Subject: //util nextpath: initial commit --- util/bin/nextpath | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 util/bin/nextpath (limited to 'util') diff --git a/util/bin/nextpath b/util/bin/nextpath new file mode 100755 index 00000000..fbffa894 --- /dev/null +++ b/util/bin/nextpath @@ -0,0 +1,12 @@ +#! /bin/sh +# +# nextpath [component...] +# +# echo $PATH with the components stripped +# +set -euf + +pattern="^\\(${1-}$(shift;for i; do echo -n "\\|$i"; done)\\)$" + +echo -n "$(echo -n "$PATH" | tr : '\n' | grep -v "$pattern")" | tr '\n' : +echo -- cgit v1.2.3