fastmod
fastmod copied to clipboard
Allow file list to be passed via stdin
Sometimes I have a list of files (for example, from a BigGrep query) and want to pass this to fastmod via stdin, but it only accepts file paths in the command line.
Something like this works, but it's kinda ugly and has the potential to hit the command line length limit if the list is long enough.
# From BigGrep
fastmod '\bFoo\b' 'Bar' $(tbgs -sl 'Foo')
# From a file containing a list of paths
fastmod '\bFoo\b' 'Bar' $(</tmp/files.txt)
Ideally I'd like to be able to do this:
# From BigGrep
tbgs -sl 'Foo' | fastmod '\bFoo\b' 'Bar'
# From a file containing a list of paths
fastmod '\bFoo\b' 'Bar' </tmp/files.txt
it's kinda ugly and has the potential to hit the command line length limit
The xargs Unix tool should solve this problem.
While it looks like xargs is not immune to argument length limits, it should resolve most cases.