https://github.com/flaque/pre
A cli that adds text to the beginning of files
https://github.com/flaque/pre
Last synced: 2 months ago
JSON representation
A cli that adds text to the beginning of files
- Host: GitHub
- URL: https://github.com/flaque/pre
- Owner: Flaque
- Created: 2018-04-25T21:40:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-25T22:09:22.000Z (about 7 years ago)
- Last Synced: 2025-01-20T10:13:54.316Z (4 months ago)
- Language: Go
- Homepage:
- Size: 1000 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pre
Pre is a simple command line tool for adding text to the beginning of a file.
You previously could do this ["easily"](https://media.giphy.com/media/ANbD1CCdA3iI8/giphy.gif) with `sed`:
```bash
$ sed -i.old '1s;^;to be prepended;' inFile
```But now you can just do it with `pre`:
```bash
$ echo "some text in front" | pre someFile.txt | sponge someFile.txt
```If you don't have sponge, you can get it from `moreutils`:
```
# mac
brew install moreutils# ubuntu/linux
apt-get install moreutils
```## Install
If you have go, you can install this with:
```
go get -u github.com/Flaque/pre
```