'How to parse the output of git status and sent it to another program with a batch file under Windows?
I want to capture the result of git status -s which will output something like this:
M /path/to/modified/file.py
M /path/to/another/modified/file2.py
The first 3 characters are to be removed. I want to have this:
/path/to/modified/file.py, /path/to/another/modified/file2.py
(take each line of git status -s, strip the first 3 characters and glue them with a comma on a single line).
I will then send that string to another program (as an argument) who will work on those files.
Is it possible to do that with a batch (.bat) file under Windows?
I saw that you can do a substring with something like set str=%str:~3,10% but I had not found how to capture the output of git and split by lines and get each line length...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
