lprefix

Crates.iolprefix
lib.rslprefix
version0.1.1
sourcesrc
created_at2021-08-17 11:20:06.69856
updated_at2021-08-17 11:22:26.847562
descriptionA tool for prefixing lines in pipes
homepage
repositoryhttps://github.com/tsatke/lprefix
max_upload_size
id438397
size6,786
Tim Satke (tsatke)

documentation

README

lprefix

A small tool to prefix lines in a script.


While using xargs, I found it hard to use sed to prepend something to lines in the output because of its regex interpretation. That's why I hacked this together.

Install

cargo install lprefix

Example

Example of how I use it:

forall () {
	local P=${P:-1} 
	local ARG="cd {} ; pwd ; $@" 
	find . -type d -depth 1 -maxdepth 1 | xargs -n 1 -P ${P} -I {} bash -c "$ARG | lprefix '{}'"
}
Commit count: 6

cargo fmt