19 lines
341 B
Python
Executable File
19 lines
341 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import select
|
|
import os
|
|
from sys import stdin, stdout, argv
|
|
|
|
if stdin.isatty():
|
|
path = os.environ['PATH']
|
|
else:
|
|
path = stdin.readline()
|
|
|
|
filtered = []
|
|
parts = path.strip().split(':')
|
|
parts.extend(argv[1:])
|
|
for part in parts:
|
|
if part not in filtered:
|
|
filtered.append(part)
|
|
stdout.write(':'.join(filtered) + "\n")
|