DeeNewcum / dotfiles

my personal config files
12 stars 4 forks source link

create -f, a tool that filters filenames based on Perl flags #18

Open DeeNewcum opened 12 years ago

DeeNewcum commented 12 years ago

The tool should support ALL of Perl's -X flags that are relevant to files / directories.

It should take in a list of path names from stdin, and output all pathnames to stdout that match the specified criteria.

The script can take any number of flags on its command line. But the first flag is actually $0 -- the script's own name. This takes advantage of the fact that Bash lets you run executables that look like flags:

> function -f() { echo it worked; }

> -f
it worked

The script itself should be symlinked to all the other flags available, eg. -x, -T, etc. This lets you do things like:

> dpkg -L firefox | -f

> dpkg -L firefox | -d
DeeNewcum commented 12 years ago

This issue is somewhat related to issue #5. However, this script is explicitly only a filter, and 'loc' is a little more than that.