I have the below string:
"BBBB,AAAA"
seperated with comma
. I need to append .done
with each value of the string.
When i try below. It doesnot work. I try to replace ,
with .done
but its doesnot work. Also i need the .done
at the end of both AAAA
and BBBB
-bash-3.2$ echo "AAAA,BBBB" |tr "," ".done"
AAAA.BBBB
Expected Output:
AAAA.done BBBB.done
Thanks for your help.
Edit:
After @Ravindra Suggestion, i modified it little bit and its working fine but the problem now is to trim the spaces.
-bash-3.2$ echo "AAAA,BBBB ,CCC, DDD" | sed 's/,/.done /g;s/$/.done/'
AAAA.done BBBB .done CCC.done DDD.done
^
getting space here
OS name: SunOS