SED is a useful Unix command line tool I use for simple text replacement.
Here’s an example to see the directories included in your Windows PATH environment variable. (I use MinGW for a Unix-like Shell in Windows)
displays all directories on one line separated by semicolons.
sed, we can list each directory on its own line.
echo $PATH | sed 's/:/\n/g'
echo $PATH, then pipe the output to the
sed command to do our string replacement. The
/g modifier will substitute ALL matches, not just the first.
Now each directory is listed on a separate line.
Additionally, if you are looking for a specific directory, for example you want to see which SVN installation is included in your PATH, you can use the
echo $PATH | sed -e 's/:/\n/g' | grep -i 'svn'
Once again we pipe the output from
sed and use
grep to show only directories that include SVN. The
-i option is to ignore case (if your folder name includes the text “Svn”, “SVN”, etc.)