1745795 Members
3462 Online
108722 Solutions
New Discussion

tranlate "tr" with awk

 
SOLVED
Go to solution
lawrenzo
Trusted Contributor

tranlate "tr" with awk

Hi

 

Please help ...

 

I want to use awk to seperate a command output from

 

a,b,c,d,e | tr -s ',' '\n'

 

a

b

c

d

e

 

how can this be achieved?

 

thanks

 

Chris

 

hello
1 REPLY 1
Dennis Handly
Acclaimed Contributor
Solution

Re: translate "tr" with awk

You want to replace your tr(1) command by awk?

 

echo "a,b,c,d,e" | awk -F, '

{

for (i = 1; i < NF;  ++i)

   print $i

}'