Skip to content
This repository was archived by the owner on Apr 3, 2021. It is now read-only.

johnweldon/cleanpath

Repository files navigation

cleanpath

Simple tool to clean up PATH like strings by removing redundant and incorrect entries but keeping the relative order of the paths that remain.

For example:

$ export FAKEPATH=/usr/bin:/usr/local/bin:/usr/bin:/usr/sbin:.
$ export FAKEPATH=$(cleanpath $FAKEPATH)
$ echo $FAKEPATH
/usr/bin:/usr/local/bin:/usr/sbin

Notice:

  1. Redundant paths removed, but relative order of first occurence is maintained.
  2. Relative (unsafe) paths removed.

Build Status GoDoc

About

Go tool to cleanup PATH-like strings.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages