Thread: Inversion and the addition of characters in the sed
i have characters:
i want in sed:code:1 2 3 4 5
i have written:code:a 1 b 2 b 3 b 4 b 5
i received:code:echo -e '1\n2\n3\n4\n5' | sed -n -e '1!g;h;$p' -e '1a a' -e '2,$a b'
bad result. me somebody?code:a b b b 5 4 3 2 1 b
if line '1', append 'a' beforecode:echo -e '1\n2\n3\n4\n5' | sed -e 's|^1$|a\n1|;s|^\([1-4]\)$|\1\nb|'
if line '[1-4]', append 'b' after
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Inversion and the addition of characters in the sed
Ubuntu
Comments
Post a Comment