-
-
Notifications
You must be signed in to change notification settings - Fork 336
Replace String within Multiple Files #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @sam-mininberg, great suggestion! I can see where this would be useful, but I'm not sure how well it fits into the existing model of "everything is a pipe" that This might be better implemented as a custom |
Thanks for your quick reply, @bitfield! You make a good point about the output from No worries if |
Here's what I came up with:
Please let me know what you think, thanks! |
Nice! Could you use |
Thanks for the feedback @bitfield! Sure, here's my updated implementation:
Since Please let me know what you think. Thanks! |
Nice! I think this is sufficiently simple and elegant that the library itself doesn't really need a built-in Would you like to produce a PR to add this example to the README? |
That sounds good! I'll start working on that. |
Hi! I started using script recently, which I've found very useful. One pattern I've found myself using is making in-place replacements across multiple files like this:
script.ListFiles("*.txt").ExecForEach("sed -i 's/tpo/typo/g' {{.}}").Wait()
I think it would be nice to have a "ReplaceInEach" function so that I could replace all sed calls with script equivalents. For example:
script.ListFiles("*.txt").ReplaceInEach("tpo", "typo")
Please let me know what you think. Thanks!
The text was updated successfully, but these errors were encountered: