``` Usage: pathmerge [OPTIONS] [paths]...
Arguments: [paths]... list of paths to include
Options:
-d, --delimiter
```sh PATH="/path1:/path2:/path3" PATH="$(pathmerge /path4)" echo $PATH
/path1:/path2:/path3:/path4 ```
```sh NEWPATH="$(pathmerge --path /a:/b:/c /z)"
echo $NEWPATH
/a:/b:/c:/z ```
```sh UGLYPATH="/a:/b:/c:/a:/a:/c:/b:/c" CLEANPATH="$(pathmerge --path $UGLYPATH)
echo $CLEANPATH
/a:/b:/c ```
```sh PATH="/a /b /c /c /c" NEWPATH="$(pathmerge --delimiter ' ' /z)"
echo $NEWPATH
/a /b /c /z ```
```sh PATH="/c:/a:/b" NEWPATH="$(pathmerge --sort)"
echo $PATH
/a:/b:/c ```
delimiter
does not cause the output to change the delimiter,
only what the logic triggers off of.pathmerge
does not modify anything in the shell or environment, it only
allows you to manipulate PATH formatted strings and outputs those strings.
It is still up to the user to push those strings into their appropriate
environment variable. e.g. PATH=$(pathmerge)
to read from env, Deduplicate
then push back into the PATH
variable.pathmerge
is primarily expected to be called/used by .profiles
and .*rc
files.WIP