14

Multiple repetitions

view full story
linux-howto

http://www.unix.com – In the below example, sed will consider the first field and prints it to twice.. % echo "123 abc" | sed 's/[0-9]*/& &/' 123 123 abc Suppose if the input given is "123 abc def 345" then also it will consider only the 1st field. If I require output as "123 abc def 345 345" i.e, sed should convert the given field where ever it is. % echo "123 abc def 345" | sed 's/[0-9]*/& &/' My expected output should be : 123 abc def 345 345 Can you please help me ? Thanks in advance... (HowTos)