#line #script #sed #prefix #pipe #prefixing

nightly app lprefix

A tool for prefixing lines in pipes

1 unstable release

0.1.1 Aug 17, 2021
0.1.0 Aug 17, 2021

#18 in #sed

MIT license

4KB

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 '{}'"
}

Dependencies

~335–480KB