Skip to content

Replace String within Multiple Files #229

Open
@sam-mininberg

Description

@sam-mininberg

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions