I have one string
string1=user/password:IP_ADDR:Directory
I need to replace string1 value like store into string2
string2=user password:IP_ADDR:Directory
i.e replace "/" character by '<space>' character
But i wouldn't use any file in the meantime.
Please help me.........................
One way to do it.
echo "${string1}" | sed -e "s|\/| |g"
Hi,
echo "user/password:IP_ADDR:Directory
" |sed 's/\// /g'
user password:IP_ADDR:Directory
or
echo "user/password:IP_ADDR:Directory
"| awk -F"/" 'OFS=" " {print $1,$2}'
user password:IP_ADDR:Directory
Thanks
Sha
Thanks vino
Thanks Shahul
Absolutely helpful..........
with bash
# echo ${string1/\// }
user password:IP_ADDR:Directory