fastmod icon indicating copy to clipboard operation
fastmod copied to clipboard

Allow file list to be passed via stdin

Open Daniel15 opened this issue 11 months ago • 1 comments

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

Daniel15 avatar Jan 07 '25 21:01 Daniel15

it's kinda ugly and has the potential to hit the command line length limit

The xargs Unix tool should solve this problem.

swolchok avatar Jan 10 '25 17:01 swolchok

While it looks like xargs is not immune to argument length limits, it should resolve most cases.

nk9 avatar Oct 05 '25 23:10 nk9