Project

General

Profile

« Previous | Next » 

Revision 9725

lib/sh/util.sh: added PATH_rm(), which removes components from the PATH

View differences:

lib/sh/util.sh
594 594
}
595 595
set_paths
596 596

  
597
PATH_rm() # usage: PATH_rm path... # removes components from the PATH
598
{
599
	echo_func; echo_vars PATH; : "${PATH?}"
600
	PATH=":$PATH:" # add *extra* : to match at beginning and end
601
	for path in "$@"; do PATH="${PATH//:$path:/:}"; done
602
	PATH="${PATH#:}" # remove any remaining extra leading :
603
	PATH="${PATH%:}" # remove any remaining extra trailing :
604
	echo_vars PATH
605
}
597 606

  
607

  
598 608
#### verbose output
599 609

  
600 610

  

Also available in: Unified diff