Greetings for the day.
I request your thoughts on the below.
I have replace one particular substring in a string.I could get the substring value using awk command.
Thanks for the prompt response. I'm using Ksh.Most of the string functions are not working.More over the above solution only replaces the first occurance of the substring. But if i have many occurances like that how can i do that if want the replacement to be done at a particular place?
If you have not veryveryold ksh then string manipulation is like posix says. (Posix has used ksh93 ...). So you can use bash, ksh93, ...
If you use some commercial unix, usually they have many ksh version in different location:
find / -name ksh
How to test have you ksh93/posix compatible shell ? Ex. take two first letters from your LOGNAME variable:
substr=${LOGNAME:0:2}
echo "$substr"
# take first two letters then something new next 4 letters and rest of str is still old
newstr="${str:0:2}NEW${str:6}"