blob: fbffa894e96667c222b8c8b20ff2f967f9d92a66 (
plain)
1
2
3
4
5
6
7
8
9
10
11
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
|