Verify all the paths in the PATH directory
Here is the command to test that all the directories in your path actually exist.
(<a class="zem_slink freebase/en/internal_field_separator" title="Internal field separator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Internal_field_separator">IFS=:;for p in $PATH; do test -d $p || echo $p; done)
And the explanation :
Set the IFS to ”:”
now we loop through the PATH variable
and test all the directories with ”test -d”
Here is another version without IFS:
for i in ${PATH//:/ };do test -d $i || echo $i;done
and next one without the test command:
for i in ${PATH//:/ };do [ -d $i ] || echo $i;done
Related articles by Zemanta
- Modifying the bashrc or bash startup files. (amit-agarwal.co.in)
- Finding an Absolute Path (zachgraeve.com)
- Resolving PHP Version Conflicts while Developing for Azure (nofluffjuststuff.com)
- Configuration of Redmine on Ubuntu (teabreak.pk)
Related Articles:
- 2010/06/06 colors in bash – script to display all the possible colors.
- 2010/06/02 Google staff dropping Windows for Macs, Linux PCs
- 2010/06/04 PuTTY alternatives - AlternativeTo.net
- 2010/06/03 Modifying the
bashrc or bash startup files. - 2010/06/02 Logwatch for Linux Systems.
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.