I have problem with formating text in BASH using sed. This is the input file:
recfun.o -> timeout.o (set_timeout) recursive.o -> timeout.o (timeout) print_recursive.o -> recursive.o (ackermann) rec-nam.o -> timeout+.o (timeout) and this shloud be the output:
recfunDo -> timeoutDo [label="set_timeout"]; recursiveDo -> timeoutDo [label="timeout"]; print_recursiveDo -> recursiveDo [label="ackermann"]; rec_namDo -> timeoutPDo [label="timeout"]; Which means this:
substitute: "-" for "_", then "." for "D", then "+" for "P", but do not substitute " ->" for " _>"
I have used sed like this:
sed -e 's/./D/' file | sed -e 's/+/P/' | sed -e 's/-/_/' But it returns the same output with just D substituted for first letter in each line.
Thank you for help!