{"repo":"webdevops/go-replace","free":true,"listed":false,"github":"https://github.com/webdevops/go-replace","clone":"git clone https://github.com/webdevops/go-replace.git","description":"Replace in file console utility written in golang (for eg. usage in docker images)","language":"Go","stars":55,"topics":["golang","command-line-tool","replace-in-files","go","grep","replace","cli","console","docker","templates"],"license":"MIT","category":"cli-tools","readme_excerpt":"go-replace Cli utility for replacing text in files, written in golang and compiled for usage in Docker images Inspired by https://github.com/piranha/goreplace Features - Simple search&replace for terms specified as normal shell argument (for escaping only normal shell quotes needed) - Can use regular expressions for search&replace with and without backrefs ( --regex and --regex-backrefs ) - Supports multiple changesets (search&replace terms) - Replace the whole line with replacement when line is matching ( --mode=line ) - ... and add the line at the bottom if there is no match ( --mode=lineinfile ) - Use golang template with [Sprig template functions]](https://masterminds.github.io/sprig/) ( --mode=template ) - Can store file as other filename (eg. go-replace ./configuration.tmpl:./configuration.conf ) - Can replace files in directory ( --path ) and offers file pattern matching functions ( --path-pattern and --path-regex ) - Can read also stdin for search&replace or template handling - Supports Linux, MacOS, Windows and ARM/ARM64 (Rasbperry Pi and others) Usage Files must be specified as arguments and will be overwritten after parsing. If you want an alternative location for saving the file the argument can be specified as source:destination , eg. go-replace -s foobar -r barfoo daemon.conf.tmpl:daemon.conf . If --path (with or without --path-pattern or --path-regex ) the files inside path are used as source and will be overwritten. If daemon.conf.tmpl should be written as dae","default_branch":null,"files":null,"tree":[],"storefront":"/r/webdevops","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/webdevops/go-replace/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}