summaryrefslogtreecommitdiff
path: root/purge_path/purge_path.py
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-21 15:21:43 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-21 15:21:43 -0400
commit2147523a89156236a3f70c2ac70e2c8304e295f3 (patch)
treec837cab0272dbaa5fb12471c14f3ca18fee3d3fa /purge_path/purge_path.py
downloadpurge_path-2147523a89156236a3f70c2ac70e2c8304e295f3.tar.gz
Initial commit
Diffstat (limited to 'purge_path/purge_path.py')
-rwxr-xr-xpurge_path/purge_path.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/purge_path/purge_path.py b/purge_path/purge_path.py
new file mode 100755
index 0000000..b752da4
--- /dev/null
+++ b/purge_path/purge_path.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+import os
+import sys
+
+if __name__ in '__main__':
+ ARGS = sys.argv[1:]
+ PATH = os.environ['PATH']
+ PATH_NEW = []
+
+ for arg in ARGS:
+ for path in PATH.split(':'):
+ if arg in path:
+ continue
+ PATH_NEW.append(path)
+
+ print("{0}".format(":".join(PATH_NEW)))