Allow passing files as single arguments to system command
See original GitHub issueSorry if this has been asked before, but I can’t find anything in the docs, web or issues. My problem is simple, I have a “system” command that accepts one argument, so I want to run it once per file, but pre-commit
passes multiple files to it. How can I avoid that and run the command once per changed file instead?
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Pass contents of file as argument to bash script
The some_file is a file that has 1 single line that I want to pass it as an argument to my bash script.sh...
Read more >How do I use the lines of a file as arguments of a command?
If your shell is bash (amongst others), a shortcut for $(cat afile) is $(< afile) , so you'd write: mycommand "$(< file.txt)".
Read more >Adding arguments and options to your Bash scripts - Red Hat
I placed this script in my ~/bin directory , where personal executable files such as scripts are intended to be stored. Look at...
Read more >Pass the Output of a Command as an Argument for Another
First, let's create an environment where we can test our strategies. Let's create two folders – one that contains files created with certain ......
Read more >How to pass arguments on the command line using bash script
The command -line argument is a parameter that we can pass to our Bash script during the execution time. They allow a user...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this is intentionally not a feature because spinning up many subprocesses one-by-one is extremely slow – the underlying tools should be fixed to support multiple
that said you can work around it as above – or as these duplicates indicate:
That does work, thank you! Hopefully this can be added as a feature to save someone else the frustration. Thanks again!