#!/usr/bin/env python3
import os, sys
len(sys.argv) < 2 and sys.exit(print('Usage: where file [file...]') or 1)
x = list(filter(lambda q: os.access(q, os.X_OK),
[p + '/' + n for n in sys.argv[1:]
for p in os.environ['PATH'].split(':')]))
len(x) and print('\n'.join(x))
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme