syker
syker

Reputation: 11282

Redirect sed output to tr

How do I redirect the output of a sed command as input to a tr command?

Upvotes: 0

Views: 940

Answers (3)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799130

You don't need tr. The y map predicate can do transliteration from within sed.

Upvotes: 2

Ryan
Ryan

Reputation: 3619

Looking at your comment, you say that the output of your sed command is on multiple lines. If it truly is on multiple lines, and not a wrap around, you could use a for loop

for i in $(sed ".."); do tr "$i"; done 

Upvotes: 0

zs2020
zs2020

Reputation: 54542

use pipe line "|"

sed ... | tr -d '...'

Upvotes: 5

Related Questions