1) sed command which puts two of the first 'w' on each line. E.g "hewor" = "hewwor".
and
2) sed command which puts two of the first digit on each line E.g "hew0r" = "hew00r"
For first one I got
$ sed s/w/ww/
for the second one I don't understand how to replicate the same digit for example I got
$ sed s/[0-9]/00/
would work but it would have to be zero each time. How do I get the same digit?
\0refers to the previously matched regex. In bsd sed this is done using&. So in your case since\0does not work, you can usesed 's/[0-9]/&&/'. Actuall using&will work even in gnu sed.