Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 738 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 738 Bytes

srn.go

Create new file with replaced strings

Installation

> git clone https://github.com/rahilwazir/srn.go.git
> cd srn.go
> go build srn.go
> sudo ln -s srn /usr/local/bin/

Usage

Replace keyword google with facebook

> srn /tmp/google.conf google facebook
New file created at: tmp/facebook.conf

Or you can skip second parameter by adding _, which indicates the basename google of file google.conf

> srn /tmp/google.conf _ facebook
New file created at: tmp/facebook.conf

Practicing golang, plus I wanted a tool which can do something similar to this (I know sed but still mmm) because I have to repeat and replace text for my nginx vhost config, now I create vhost easily :D